You can't handle the command line with only commands. You have to know the special syntax used in the terminals. For example, using capitals matters. You will get used to it.
1. Capitals
In this stage of learning, we will not use any capitals in commands. In the names of files and directories, you still have to use the capitals if there are any.
2. &&
To run to commands at once, put "&&" between the two commands. When the first command fails, the second command won't run. Otherwise, the second command will run afterwards.
3. >
To save the output of command to a file, put "> [filename]" after a command. You can find the output in that file. Example: "ls > myoutput.txt"
4. >>
This does the same thing as ">", but instead of rewriting the entire file, it appends (adds) the output to the file.
5. ""
For commands like echo, the text is put between those: "". Because the text may conflict with the bash syntax, we use these to specify that all the punctuation marks don't have any meaning. For filenames with spaces this is needed with the same reason. This may be a little hard to understand, but it is very useful.
There are far not all syntax rules of bash, but for now it's good enough. You have to learn more of those like the pipe | and the single &. You won't need those right now, but it is necessary.
The syntax may be the most difficult part of bash. For example, even I can't understand this:
sed -E '1h; /error/s/error/ERROR/; /error/s/$/ (line: &)/; /^[0-9]+/ { s/^([0-9]+) ([^ ]+)/\2 \1/; t; s/$/ - not modified/; } /foo[0-9]+/ { s/(foo)([0-9]+)/\2\1/; t; s/$/ - not modified/; }' input.txt
This is only for the very advanced ones. Don't worry.
YOU ARE READING
Linux for dummies
Non-FictionThis book will explain you Linux step-by-step. You don't have to be a computer pro to undestand this book.
