Linux Cheat sheet o: others -P: pattern is a perl regex df [options] file 3 Network & Remote by A.Mahouachi a: all -m: stop after m matches options: ssh [options] user@host ["cmd1;cmd2"] +: add mode -n: also show matching line number options: -h: human readable 1 File Commands -: remove mode -R: recurse directories -2: force protocol 2 =: exact mode -c: only show matching lines count -i: list inodes info ls [options] file -P: no dereference of sym links -o StrictHostKeyChecking=no: ignore options r: read –exclude=glob : exclude these warnings due to remote host key w: write –include=glob : only consider these 2 Process Commands change -a: show hidden files x: execute files and search for dirs -A: show hidden files except . and .. cat [options] file(s) ps [options] -X: forward X11 display X: search for dirs options -d: only show directories s: setuid or setguid options: wget [options] url -h: human readable size t: sticky bit -v: non ascii chars except tab and eol -e: all processes options: -i: inode info -T: show tabs numeric mode -f: full listing -b: run in background -l: long list format -t: equivalent to -vT -H: show hierarchy -o file: print wget output in file -m: output as csv format: [0-7]1,4 -E: show eol end of line example: 755 -p pid: this process pid -o /dev/null: suppress wget output -n: numeric uid and guid -e: equivalent to -vE -C cmd: this command name cmd -q: be quiet -r: sort in reverse order first digit: setuid(4), setguid(2) -A: equivalent to -vET second digit: owner perms -w: wide output -d: debug -S: sort by file size -s: remove repeat empty lines -ww: to show long command lines -O file: save response to file -t: sort by modification time third digit: group perms tail [options] file fourth digit: others perms -l: long listing, including wchan -c: resume file download tree [options] dir options -o x,y,z: show columns x y z -S: print server headers options read: 4 write: 2 -f: show end of file live -o user,pid,cmd: show columns user, -T N: timeout after N seconds -d: only directories execute: 1 -35: show last 35 lines pid command –user=user: basic http auth user -q: be quiet -N: negation –password=password: basic http auth -f: show full paths find path [options] [tests] [actions] -P pattern: only matching pattern head [options] file -u user: processes owned by user password options: –save-cookies file: save cookies to file -I pattern: except matching pattern options -u user -N: processes not owned by user -h: print sizes in human readable for- -mindepth: start from min level in hier- –sort=x,y: x y are columns in ps output –load-cookies file: use file as cookies mat archy -35: show first 35 lines –sort=user: sort by user –post-data=string -C: use colors -maxdepth: end with max level in hier- -q: be quiet –sort=+time: sort by cpu time asc –post-file=file -L max: max level depth archy tac file(s) –sort=-time: sort by cpu time desc –no-check-certificate: ignore ssl certifi- tests: print files starting from last line –sort=size: sort by memory size cate cp [options] source dest -name "xyz*": name like xyz* cut [options] file –sort=vsize: sort by vm size curl [options] url options: options -iname "xyz*": like -name but case in- options top [options] sensitive -b: backup dest before overwrite -d char: use char as delimiter -H header: like -H "Host: st.com" -type d: only directories options -u
<<