Show your current directory
Viewpwd
COMMANDS
Navigate the terminal, work with files, then inspect permissions and processes.
66 commands
pwd
ls
ls -lah
cd /PATH/TO/DIRECTORY
cd ..
cd ~
mkdir DIRECTORY
mkdir -p PATH/TO/DIRECTORY
Creates missing parent directories too.
touch FILE
If the file exists, updates timestamps without clearing its content.
cp -i SOURCE DESTINATION
Prompts before overwriting an existing destination.
mv -i SOURCE DESTINATION
Prompts before overwriting an existing destination.
cat FILE
less FILE
Press q to quit; / searches within the file.
head -n 30 FILE
tail -n 50 FILE
tail -F FILE
Retries when the file is replaced. Stop with Ctrl+C.
find . -type f -name "*.log"
Searches under the current directory. Keep the pattern quoted.
grep -n -- "PATTERN" FILE
PATTERN is a regular expression.
grep -Fn -- "TEXT" FILE
Treats the search text as literal characters.
wc -l FILE
whoami
id
ls -l FILE
stat FILE
chmod 600 FILE
Owner can read and write; group and others have no access. Does not change ownership.
chmod u+x SCRIPT.sh
df -h
du -sh DIRECTORY
Permission errors may mean some paths were not counted.
ps -ef
kill -TERM PID
Verify the process ID first. Sends a termination signal.
rmdir DIRECTORY
Only succeeds if the directory is empty.
rm -i -- FILE
Permanently deletes the named file after a prompt; does not move it to trash.
man COMMAND
For example: man ls. Press q to quit.
help cd
For Bash shell built-ins.
wc -l -w -c FILE
sort -n FILE
sort FILE | uniq -c
cut -d: -f2 FILE
Selects the second colon-separated field.
awk '{print $1}' FILEgrep -n '^ERROR ' FILE
grep -v 'PATTERN' FILE
sed 's/^OLD$/NEW/' FILE
Prints the result without changing FILE.
sed -i 's/^OLD$/NEW/' FILE
Linux sed example; overwrites the matched lines. Review or back up important files first.
COMMAND | tee output.txt
Overwrites output.txt; tee -a appends.
ln -s TARGET LINK_NAME
The target path is interpreted from the link’s directory.
readlink LINK_NAME
stat FILE
umask 077
Applies to subsequently created files in this shell.
find . -type f -name '*.log'
find . -type f -name '*.log' -print0 | xargs -0 wc -l
Avoids splitting paths containing spaces.
ls -la
file FILE
Requires the file utility.
diff -u BEFORE AFTER
Exit 1 means differences; greater than 1 means an error.
cmp FIRST SECOND
Exit 0 means identical; 1 means different.
sha256sum FILE > FILE.sha256
Writes a digest and filename into a new checksum file.
sha256sum -c FILE.sha256
tar -tzf ARCHIVE.tar.gz
tar -czf ARCHIVE.tar.gz DIRECTORY
Creates or replaces the named archive.
tar -xzf ARCHIVE.tar.gz -C DESTINATION
Inspect untrusted archive paths and use a dedicated destination.
ps -ef
ps -p PID -o pid,ppid,comm
kill -TERM PID
Check the PID and owner first; this can stop running work.
ss -lnt
Linux iproute2 utility; package availability varies.
ip address show
Linux iproute2 utility.
journalctl -u SERVICE -n 100 --no-pager
Requires systemd journal access.
systemctl status SERVICE --no-pager
Requires a systemd-based environment.
No match. Try another command, task, or turn off the changes filter.