You are on page 1of 2

Basic Commands

ls Show the files in the directory


cat Show what is within a file
touch create a file
echo print what u write, u can print into a file with (echo Hello >> ok.txt) >>
appends output
>
rewrite
cd
mkdir
cp
mv

***********************************************************************************
***********************

Linux Operators

&& and it requiere that first command executes successfully

& is like a + command

$ Enviroment variable like HOME and USER, export variable=value echo $USER

| pipe allows you to take the output of a command and use it as input for a
second command

; it works like && but doesnt requiere that the first command works

***********************************************************************************
************************

Commands permissions

chown
chgrp
chmod

***********************************************************************************
*************************************
Links

hafind dir -grouprdlink its like a copy ln


softlink or symbolic link its like acces direct ln -s
***********************************************************************************
************************************
find
find dir -user
find dir -group
find -perm

grep
grep <string> <file>
grep <string> <file> <file2>

find /* | grep test1234

grep hello -test -n

***********************************************************************************
*****************************
Misc

sudo -U specify which user you want to run a command as. sudo -U jen whoami

adduser and addgroup


usermod -a -G <groups seperated by commas> <user>

/etc/passwd - Stores user information - Often used to see all the users on a system

/etc/shadow - Has all the passwords of these users

/etc/sudoers - Used to control the sudo permissions of every user on the system -

/usr - Where all your software is installed

/bin and /sbin - Used for system critical files - DO NOT DELETE

/var - The Linux miscellaneous directory, a myriad of processes store data in /var

ps
ps -ef
top

You might also like