Most UBUNTU Commands

File System

cp originalFile newFile : copy original to new
rm file : remove file
rm -rf directory : remove non-empty directory
rm -r directory : clean directory
rmdir directory : remove empty directories
mkdir directory : create directory
mv fileFrom fileTo : move file from to
ls director : display all directory content
dir directory : diplay all directories inside directory
ls -l file : file create date and owner and mod
cat file.txt file2.txt : display file content
pwd : get current path
cd path: set the current path
chmod {options} filename : change permision of file
chown USERNAME:GROUPNAME path : change owner
chown -R USERNAME:GROUPNAME path : change owner recursive
chgrp group file1 file2 dir1 : change group of file
touch file : create file
zip|unzip file

cat ./file.txt | grep "^hello .*ld.*$"
user@host:/home/user$ chmod ugo+rwx file4 #add read and write and execute permision for owner and group and others


lspci : pci hardware info
inxi : hardware info more readable need to install
free : memory size and how much used and free
dmesg : debug all devices
lsusb : all serial devices connected
top : monitor all processors
kill -9 pid : force kill for proccesor


sudo : play command as root
sudo -i : always as root
adduser userName : add user
su : change user
usermod -aG group user : add user to group
deluser user group : remove user from group
groups : display groups of current user
exit : logout
passwd : change passward of current user
adduser –system userName : add system user
addgroup group : add new group