Basic Shell Commands

Practice how to use the shell in Linux

Practice how to use the shell in Linux


M. S.
This flashcard set covers basic shell commands for managing files, directories, and system processes, suitable for users at an intermediate level. It focuses on essential commands like searching within files, manipulating directories, handling packages, and managing devices. Ideal for those looking to enhance their command-line skills, the set provides practical examples for tasks such as deleting files, changing permissions, and executing scripts. Users will learn to navigate directories, manage system updates, and perform basic system administration tasks efficiently.
Cartes-fiches
58
Utilisateurs
23
Langue
Anglais
Catégorie
Informatique
Niveau
Autres
Créé / Mis à jour
11.02.2017 / 12.02.2026

Cartes-fiches

Access folder

cd folder

Absolute path of current directory

pwd

Access parent directory

cd ..

Access home directory

cd

List files in current directory

ls

List files in folder1 and folder2

ls folder1 folder2

List all files in current directory (also hidden files)

ls -a

List all files in current directory as a detailed list

ls -l

Print the content of file on the console

cat file

Copy the content of source to destination

cp source destination

Move  file to destination

mv file destination

Rename file1 to file2

mv file1 file2

Delete file

rm file

Make a new directory called directory

mkdir directory

Remove empty directory

rmdir directory

Remove non-empty directory

rm -r directory

Run program which is located in the current folder but not specified in PATH

./program

Become root

sudo su

Become user

sudo su user

Log out of session

exit

Suspend PC

systemctl suspend

Repeat last command as root

sudo !!

Check for updates

zypper ref

Install updates

zypper up

Look for a package

zypper se package

Install a package

zypper in package

Uninstall a package

zypper rm package

Delete temporary install data

zypper clean

Mount a device on mountpoint

mount device mountpoint

Synchronize caches

sync

Unmount a device from a mountpoint

umount mountpoint

Show disk usage in human-friendly manner

df -h

Make file executable

chmod u+x file

Run file as shell-script

sh file

Display the date, time and time-zone

date

Ask a question and save the answer

read -p "question" answer

Execute command1 and when done so successfully, execute command2

command1 && command2

Install updates without asking for confirmation

zypper -n up

Shut down PC

poweroff

Execute command1 and then command2

command1; command2

Étudier