Introduction to CLI Flashcards
What characters tells that a prompt is for a normal user
$
What characters tells that a prompt is for root user
#
Execute command1 and command2 unconditionally one after the other
command1 ; command2
Execute command2 after command1 only if later is successful
command1 && command2
Execute command command2 after command1 if the later fails
command1 || command2
Print the time
date +%R
Print the date in the format 02/27/2022
date +%x
Determine the type of the file /tmp/file-name.ext
file /tmp/file-name.ext
Show the inode of the file newfile.txt
ls -li newfile.txt
Create hard link of file newfile.txt
ln newfile.txt /tmp/newfile-hlink2.txt
Limitations of hard links
1) No cross file systems
2) Not applicable to folders
How do you know the file system that a set of files are on
df
Create symbolic link
ln -s /home/user/newfile-link2.txt /tmp/newfile-symlink.txt
Create folders RHEL8, RHEL7, RHEL9 in one command without writing RHEL many times
mkdir ../RHEL{7,8,9}
Print today day of the week
date +%A