Linux Flashcards
The VI editor lets a user create new, or edit existing ______ . The command to start the VI editor is vi, followed by the ____ name
files
file name
The command to quit out of VI is
:q or :wq saves
You can specify a different file name to save to by specifying the name after the
:w filename
How do you show where you are in the cmd?
pwd
print working directory
how to access etc under the root folder?
cd /etc
how to get to home folder easily?
cd (automatically go to home directory)
How to get to parent directory?
cd ..
List the contents of a directory?
ls
ls ~l or ll(long list)
ls /etc (to get a specific file directory listing
ls /bin /sbin (for two directories)
ls ~all ~ (all the files (including hidden files) in your home directory)
ll /boot (shows file size)
How to create a new directory in home directory?
mkdir /testdir
How to make a file in another directory in the etc directory?
cd /etc ; mkdir /newdir
Create in one command the directories ~/dir1/dir2/dir3 (dir3 is a subdirectory from dir2,and dir2 is a subdirectory from dir1)
mkdir ~p ~/dir1/dir2/dir3
p creates parent structure files on the fly
How to remove a directory?
rmdir filename
How to rename files?
mv (oldfilename) (newfilename)
mv wolf.jpg wolf.pdf
Display the first 12 lines and last line
of /etc/services.
head -12 /etc/services
tail -1 /etc/services
Create your user account
useradd -c “Jaimie Drost” jdrost
name then username