Basic linux commands

Written by kisa

On May 17, 2020

Here are some useful commands in linux

 

Command Possible Keys Action
touch create file
pwd print working directory
ls -l (more info) -la (hidden included) list files
echo
mkdir make directory
cd change directory
rm -r  (recursively) remove
rmdir remove directory
cp copy file/directory
mv move (rename)
type/whereis what type of command or where it “lives”
who currently logged in user
man manual
id
cat concatenate file to terminal (view/print – file)
usermode [KEYS] “editedId” “whatToAdd” -aG (add group) -G (replace all with..)
chmod 

example: chmod u+rw,g-x+rw,o-rwx filename

chown 

change file/dir owner

chgrp change file/dir group

 

 

 

Useful directories:

 

/etc/passwd

-> users,deamons info: uid, gid, work directory…

 

/etc/group

-> shows – group:guid

 

/etc/shadow

-> where hashed passwords are stored

 

 

 

Ownership of Linux files

 

Absolute(Numeric) Mode

 

Number Permission Type Symbol
0 No Permissions
1 Execute –x
2 Writ -w-
3 Execute+Write -wx
4 Read r–
5 Read + Execute r-x
6 Read + Write rw-
7 Read + Write + Execute rwx

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *