Soc Linux Cheatsheet
Soc Linux Cheatsheet
Action
ls
ls -la
ls -R
ls -F
ls --color=auto
cd dir
pwd
mkdir dir
rmdir dir
rm file
rm -r dir
rm -f file
rm -rf dir
cp file1 file2
cp -r dir1 dir2
mv file1 file2
touch file
cat file
less file
head file
tail file
tail -f file
grep word or "phrase" file
grep word or "phrase"*
grep -i word or "phrase" file
grep -i word or "phrase"*
find . name file
find dir name file
File Permissions
chmod octal file change the permissions of file to octal, which can be found separately for user, group, and
world by adding:
4 read (r)
2 write (w)
1 execute (x)
Examples:
chmod 777 read, write, execute for all
chmod 755 rwx for owner, rx for group and world
Help commands
Command
Action
System commands
Command
Action
date
cal
whoami
df
which progname
Short cuts
Command
Action
Ctrl+C
Ctrl+D
Ctrl+U
!!
history
!#
up arrow
tab
Remote Access
Command
Action
ssh $USER@$HOST
ssh -Y $USER@$HOST