ECM 1413 Linux commands Flashcards
ls
list files and directories
ls options
-l: Long format listing
-a: Include hidden files
-h: Human-readable files
cd
change directory
pwd
Print current working directory
mkdir
make new directory
rm
Remove files and directories
rm options
-r: Remove directories recursively
-f: Force removal without confirmation
cp
copy files and directories
(-r to copy recursively)
mv
move/rename files and directories
touch
create an empty file or update file timestamps
cat
view the contents of a file
head
Display the first few lines of a file
-n to specify the number of lines to display
tail
Display the last few lines of a file
-n to specify the number
ln
create links between files
-s to create a soft link (hard by default)
find
search for files and directories
-name to search by file name
-type to search by file type
chmod
change file permissions
u: user/owner permissions
g: group permissions
o: other permissions
+: add permissions
-: remove permissions
=: set permissions explicitly
chown
change file ownership
chgrp
change group ownership
unmask
set default file permissions
tar
create or extract archive files
-c: create a new archive
-x: Extract files from an archive
-f: Specify the archive file name
-v: verbose mode
-z: compress the archive with gzip
-j: compress the archive with bzip2
gzip
compress files
-d: Decompress files
zip
Create compressed zip archives
-r: Recursively include directories
ps
Display running processes
-aux: Show all processes
top
Monitor system processes in real-time