tut 1 Flashcards
man date
gives the access to information like the manual on how to obtain the dates and timings, etc.
date
mon 19 aug 2024 09:23:56 AM +08
date –help
clear
deletes everything
date +%R
09:29
provides 24hr time
date +%x
19/08/2024
history
shows the history of the commands used
!5
uses the 5th command under the history list
whoami
ubuntu
(shows the current log in user)
sudo su -
switch to the privileged user/ system administrator
cat/ etc/passwd
contains the user name and info
cat/ etc/shadow
stores the info for the password of the file
what do you do if u want to access a file with a password as a system administrator?
sudo cat/ etc/shadow
file/ etc/passwd
ASCII text
(Tells us what type of file it is)
ls
lists down the directories and files in the current working directory
cd D
goes to the folder that starts with D
cd Desktop/
ls
gives us all the files and types of files under the Desktop directory
cd Desktop/
ls
file cat.jpg
gives us more information about the file named “cat.jpg”
cat /etc/passwd
head/ etc/passwd
gives us all the info in the cat file.
shows us the first 10 lines
cat /etc/passwd
head -5 / etc/passwd
shows us first 5 lines
cat /etc/passwd
tail / etc/passwd
shows the last 10 lines
cat /etc/passwd
tail -1 / etc/passwd
shows the last line
cat /etc/passwd
wc /etc/passwd
51 90 3035
shows the number of character, words and lines
man wc
manual