Linux Flashcards
What is the command to partition/ make a new file system?
mkfs -t ext4 /dev/sdb3
What is the command to mount the file system?
mount /dev/sdb3
What is the command to check for how much disk space is free?
df
What is the command to unmount the partition?
unmount /dev/sdb3
What are the contents of an inode?
username UID GID (default group) Comment home directory shell
What is the command to create a new user account?
useradd
What is the command to delete an account
userdel
What is the command to modify an account?
usermod -c
What is the command to create a group?
groupadd
What is the command to delete a group?
groupdel
What is the command to modify a group?
groupmod -g 1337
How do you switch users?
su
How do you check for which user account is current?
whoami
How do you run super user commands?
sudo
How to switch super users?
sudo su
What are the different file systems under the root?
bin boot dev etc home root run sbin tmp usr var
What is the command to copy files?
cp f1.txt /home/mtork/lesson5/dir1
What is the command to only copy files with a certain extension and add verbose?
cp -v *.txt /home/mtork/lesson5/dir1
What is the command to copy directories recursively?
cp -r dir2/ dir3/
What is the command to rename files?
mv dir4 dir44
how to check the last n lines of a file?
tail -n 100 /var/log/messages
How to create an archive and list it?
tar -cf archive.tar foo bar # Creates archive.tar from files foo and bar
tar -tvf archive.tar # List all files in archive.tar verbosely.
tar -xf archive.tar # Extract all files from archive.tar
How to create a compressed file?
gzip file1.txt
How to uncompress a file?
gunzip file1.txt