NWP lab3 Flashcards
find . –name toto –print
Automatically find the file’s (path) by its name. Argument 1: (.) start search from current location Argument 2: name of the file is toto Argument3: show the location (path) on the screen
cd /etc
etc: location where there are files controlling the machines configuration like IP address. It is one of the system directories.
ls –rtl resolv.conf
Get detailed information about resolv.conf only
find / -name resolv.conf –print
Search the entire machine for file “resolv.conf” and print the path on the screen (usually the system does not allow, therefore you must log in the root)
find / -name resolv.conf –print | more
Show the output in pages because ( | more) is used
find / -name “*ress*” –print
This command is used if you are trying to find a file that you only remember a few letters of those letters are put in this letters “* *” the stars indicate any letter
find / -name “*ress*” –print > toto
Save the output of the search in file (toto). File toto is created automatically due to this command and the output is automatically in the file.
passwd
Change password
vi toto
Opens a file in root. (interactive viewer)
esc :q
To exit. Esc is used because there are two modes (writing and editing) therefore exiting editing mode and going to command mode.
esc dd esc 4dd
dd removes lines. dd removes 1 line while 4dd removes 4 lines.
esc u
Undo
esc x
Deletes one character. To delete i386 from /i386-pc put the indicator on the first letter you want to delete as shown (/i386-pc).
esc i
Insertion of text. (before the cursor) you can press esc to stop writing.
esc a
Insertion mode after the cursor.