Directory Navigation

Move up one level in the directory tree structure:

cd ..
Change directory to $HOME:

cd
Change location to a specified directory:

cd /chosen/directory
File Compression
Archive an existing file:

tar cf [compressed_file.tar] [file_name]
Extract an archived file:

tar xf [compressed_file.tar]
Create a gzip compressed tar file by running:

tar czf [compressed_file.tar.gz]
Compress a file with the .gz extension:

gzip [file_name]
File Transfer
Copy a file to a server directory securely:

scp [file_name.txt] [server/tmp]
Synchronize the contents of a directory with a backup directory using the rsync command:

rsync -a [/your/directory] [/backup/]
Users
See details about the active users:

id
Show last system logins:

last
Display who is currently logged into the system with the who command:

who
Show which users are logged in and their activity:

w
Add a new group by typing:

groupadd [group_name]
Add a new user:

adduser [user_name]
Add a user to a group:

usermod -aG [group_name] [user_name]
Temporarily elevate user privileges to superuser or root using the sudo command:

sudo [command_to_be_executed_as_superuser]
Delete a user:

userdel [user_name]
Modify user information with:

usermod

Leave a Reply

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