LOADING
203 words
1 minute
Linux commands I use regularly
2026-04-06

Commands I use on a regular basis in Linux

cd

cd means “Change Directory”

usage

obvious, change directory

syntax

cd $PATH

example

cd ~/Documents/

Tip

if you write “cd” without path, it will take you to home directory

ls

list files and directories

syntax

ls $PATH

example

ls ~/Documents/

or just write it without any path to execute it on current location

ls

Tip

ls -la is a useful command to list all files and directories including hidden ones.

mv

move file or directory

syntax

mv PATH NEW_PATH

example

mv file.txt ~/Documents/file.txt

mv directory/ ~/Documents/new_directory_location/

Tip

or can be also used to rename a file or folder

mv file.txt new_file.txt

rm

remove file or directory

syntax

rm $PATH

example

rm file.txt

rm directory/

sudo rm -rf

even though it’s dangerous, it’s useful, especially when I want to delete a directory recursively and ignore all permissions.

please don’t use it without thinking twice or on root to not destroy your system.

cp

copy file or directory

syntax

cp PATH NEW_PATH

example

cp file.txt ~/Documents/file.txt

cp directory/ ~/Documents/new_directory_location/

pkill

terminates a program with closest name

pkill program_name

history | grep “command_name”

I use it a lot to find commands I’ve used before. specifically when I want a long command but can’t remember all of its components.

ffmpeg

ffmpeg is a powerful tool for video and audio processing.

it is not a packaged command, you need to install it separately.

examples

ffmpeg -i input.mp4 -vf scale=-1<720> output.mp4

ffmpeg -i input.mp4 -vf scale=-1<720> -c copy output.mp4

conversion from mkv to mp4

ffmpeg -i input.mkv -c copy output.mp4

Some information may be outdated