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
wc -l /etc/passwd
shows the number of lines
wc -w /etc/passwd
shows the number of words
wc -c /etc/passwd
shows the number of characters
ls
shows the file we are currently doing command on ??
ls
ls -l
shows us more information about the file, when the file was created and the access settings to other users (tut 3)
cd ~
standardizes our folders, brings us back to our home folder
ls -la
shows all our hidden folder
starts with “.” is a hidden folder, for example ‘.bashrc’ is a hidden folder
ip addr
gives us the internet address, etc