0% found this document useful (0 votes)
7 views

Linux Cheat Sheet Basic Console Commands

Uploaded by

Mohammad Rahmani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Linux Cheat Sheet Basic Console Commands

Uploaded by

Mohammad Rahmani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CHEAT SHEET

LINUX - basic console commands

Software managing Exploring


dowloads latest software / packages list home folder shortcut
$ sudo apt update ~ (equals to /home/user_name/)

updates software based on previosly downloaded list root folder


$ sudo apt upgrade /

installs specific software list all files in a current diectory (included hidden)
$ sudo apt install package_name $ ls -al

find location of package files/binaries current working directory path


$ whereis package_name $ pwd

removes software but keeps configuration files change current directory to home
$ sudo apt remove package_name $ cd

removes software and configuration files change current directory to destination_path


$ sudo apt purge package_name $ cd destination_path (i.e cd ~)

shows all installed packages change current directory to one level up


$ apt list --installed $ cd ..

shows if a package is installed history of inputed commands


$ apt list -installed package_name $ history

searches installed packages based on a name manual for a command


$ dpkg -l | grep -i put_your_search_name_here $ man command_name (i.e. man cp)

shows available packages by pattern


$ apt search package-name
Files & folders
create a file
System info $ touch file_name.extension

top current processes + resources usage summary create a folder


$ top $ mkdir folder_name

Linux version copy


$ lsb_release -a $ cp ~/path_file_to_copy ~/destination (single file)
$ cp -R ~/path_to_folder ~/destination (single folder)
System info $ cp ~/*.extension ~/destination (all files with ext)
$ sudo dmidecode -t system
move
Kernel info $ mv ~/file_or_directory_to move ~/destination
$ uname -a
remove
current time and date $ rm ~/file_to_remove.extension (single file)
$ timedatectl $ rm -R ~/folder_to_remove (single folder)
$ date
find a file or a folder by name
disks usage $ find ~/destination --iname file_or_folder_name
$ df -h --total
show last lines of a file (usefull for large files i.e logs)
file system partitions $ tail file_name.extension
$ sudo fdisk -l

shows verbose info Services


$ lsblk (Disks)
$ lshw (Hardware) service commands
$ lscpu (CPU) $ sudo service service_name status
$ lsusb (USB) $ sudo service service_name start
$ sudo service service_name stop
alternative info based on DMI tables $ sudo service service_name restart
$ sudo dmidecode -t (+ component name i.e. bios)

Author: Piotr Golon, [email protected], https://blowstack.com

You might also like