DEV Community

Cover image for basic Linux commands you should know
Ahmed Elagmey
Ahmed Elagmey

Posted on

basic Linux commands you should know

Here's a simple illustration about basic Linux commands every information technology related jobs should know

command line syntax
command {option} {argument}

getting help

-- help 
man command 

Enter fullscreen mode Exit fullscreen mode

navigate between directories

pwd  
print working directory 
Enter fullscreen mode Exit fullscreen mode

cd change directory

cd /Desktop
cd .. one level up
cd ~ telda = home directory  
Enter fullscreen mode Exit fullscreen mode

List directory content

ls 
ls -h 
ls -a 
ls -lha /documents 
Enter fullscreen mode Exit fullscreen mode

create files & directories

touch filename 

mkdir dir-name 
Enter fullscreen mode Exit fullscreen mode

Reading file content

cat filename
head filename
tail filename
more filename
less filename
Enter fullscreen mode Exit fullscreen mode

copying

cp filename /destination 
Enter fullscreen mode Exit fullscreen mode

remove files & directory

rm filename
rmdir dir-name 
Enter fullscreen mode Exit fullscreen mode

user permission

read (r) write (w) execute (x)

chmod +w or chmod 2
chmod +r or chmod 4
chmod +x or chmod 1
chmod 7 for giving r+w+x permisions
Enter fullscreen mode Exit fullscreen mode

process management

ps 
ps -ef 
ps -aux 
top 

Enter fullscreen mode Exit fullscreen mode

adding users

useradd username 
passwd username for creating a password to a specific user
usermod for modified 

## 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)