ls -a: list all files including hidden files.
ls -l or ls -la: list all files and their permission info, etc.
ls -lh display the size in a human-readable way
grep
grep -r "xxx" .: search string "xxx" under current directory.
redirect the output to a file:
SomeCommand > SomeFile.txt
Or if you want to append data:
SomeCommand >> SomeFile.txt
If you want stderr as well use this:
SomeCommand &> SomeFile.txt
or this to append:
SomeCommand &>> SomeFile.txt
if you want to have both stderr and output displayed on the console and in a file use this:
SomeCommand 2>&1 | tee SomeFile.txt
(If you want the output only, drop the 2 above)
mkdir
mkdir -p aa/bb/cc
'-p' guarantees the dirs along the path can be created if it doesn't exist.
Without '-p', if you use "mkdir aa/bb/cc" while there is not aa dir or bb dir, an error would be posted and cc dir can not be created.
Table of contents generated with markdown-toc
ls
ls -a
: list all files including hidden files.ls -l
orls -la
: list all files and their permission info, etc.ls -lh
display the size in a human-readable waygrep
grep -r "xxx" .
: search string "xxx" under current directory.Redirection
Redirection (link)
Ref: https://www.runoob.com/linux/linux-comm-mkdir.html