Basic commands in Linux (Debian)

Here’s a brief overview of basic Linux commands.

Navigating to a directory

cd /path/to/directory

List the contents of a directory

ls -lisa /path/of/directory

Edit a file with the nano tool (ctrl+ x to exit)

nano filename

Delete a file or folder (-R)

rm -R /path/foldername

Copy a file or folder

cp /pathA/filename /pathB/filename

Move or rename a file or folder

mv /pathA/filename /pathB/newname

Create a folder

mkdir /path/foldername

Assign a folder and its content to the user ‘user’ and the group ‘users’

chown -R user:users /path/filename 

Manage the permissions of a file or folder and its content (tools available here)

chmod -R 750 filename

Make a file executable

chmod +x /path/filename 

Run a script

./myscript.sh

Update the package repository

apt-get update

Update software packages

apt-get upgrade

Install a package

apt-get install packagename

Search for a package

apt search packagename

Search for a file

find /path/ -name filename

Leave a Comment