Basic file commands
cheat sheet · Linux · bash https://lab.dimsanych.ru/en/wiki/files-basics/Cheat sheet
-
ls -lahdetailed directory listing -
cd dirgo into a directory -
pwdwhere am I now -
cp -a src dstcopy, preserving permissions/time -
mv a bmove/rename -
rm -i fremove with confirmation -
mkdir -p a/bcreate with intermediate directories -
touch fcreate an empty file / update its time -
ln -s tgt linka symbolic link -
tail -f logfollow a log in real time -
less filepage through a file (q to quit) -
head -n20 fthe first 20 lines -
cmd1 | cmd2pipe the first command's output into the second -
cmd > out 2>&1stdout and stderr into a file -
Ctrl+R (history) · Ctrl+L (clear) · !! (repeat)
Options
Below are the main flags of ls, cp, mv, rm, mkdir; each command has
its own detailed article (see "See also") — this is the minimum for basic work.