Back to technologies

/linux

Linux command reference

Expanded Linux terminal commands for everyday development and ops work.

24 matches

File Operations

8 commands

pwd

Print the current working directory.

ls -la

List files with hidden entries and details.

mkdir -p new-folder/subfolder

Create nested directories in one command.

touch file.txt

Create an empty file or update its timestamp.

cp -r source target

Copy a directory recursively.

mv old-name new-name

Move or rename a file or folder.

find . -name "*.log"

Search for files matching a name pattern.

rm -rf folder-name

Remove a directory and all of its contents.

Note: Use with care because this permanently deletes files.

Permissions

4 commands

chmod +x script.sh

Make a script executable.

chmod 644 file.txt

Set common read/write permissions for a file.

chown user:group file.txt

Change the ownership of a file.

sudo !!

Rerun the last command with elevated privileges.

Search & Text

6 commands

grep -R "needle" .

Search recursively for matching text.

tail -f app.log

Follow a log file in real time.

head -n 20 file.txt

Show the first 20 lines of a file.

less file.txt

Open a file with interactive paging.

wc -l file.txt

Count the number of lines in a file.

sort file.txt | uniq

Sort text and remove duplicate lines.

Processes & Networking

6 commands

ps aux | grep node

Find running Node.js processes.

top

Monitor system processes interactively.

kill -9 <pid>

Force-stop a process by its PID.

df -h

Show disk usage in a readable format.

du -sh *

Display folder sizes in the current directory.

curl -I https://example.com

Fetch only HTTP response headers from a URL.