Unix Cheat Sheet Page 2

ADVERTISEMENT

Change user password
Change user password
passwd
Copy a file or directory
cp {file1} {file2}
Recursive, copy directory and all
cp -r {dir1} {dir2}
subdirs.
Append newfile to end of oldfile.
cat {newfile} >> {oldfile}
Move (or rename) a file
Moving a file and renaming it are the
mv {oldfile} {newfile}
same thing.
mv {oldname} {newname}
Delete a file
? and * wildcards: "?" is any character;
rm {filespec}
"*" is any string of characters.
Good strategy: first list a group to make
ls {filespec}
sure it's what's you think...
rm {filespec}
...then delete it all at once.
View a text file
View file one screen at a time.
more {filename}
Like more, with extra features.
less {filename}
View file, but it scrolls.
cat {filename}
View file one screen at a time.
cat {filename} | more
Create and edit a text file.
emacs {filename}
pico {filename}
vi {filename}
Compare two files
Show the differences.
diff {file1} {file2}
Show files side by side.
sdiff {file1} {file2}
2

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 4