`

Linux Basics - 2

阅读更多

1>man(help), passwd(change password), su - root(switch user), who(who is logged in), date(date and time), echo(disply message)

echo $PATH
/usr/bin:/usr/local/bin
echo My name is $USER - Home directory=$HOME.
My name is hermie - Home directory=/home/hermie.

The echo command is very similar to the DOS command of the same name, except that the DOS echo command cannot display environment variables--it just displays a message.

2> Printing linux files

lpr paperless-office.txt

The lpr command makes a copy of your file and stuffs it in the system's print queue (a process called spooling), so you can change or delete the original file without harming your printout.

The lpr command will accept two optional flags:

-r Delete the file after printing.

-s No spooling (don't make a temporary copy for printing).

The -r flag tells the system to delete the file after printing, and -s tells the system to print directly from the original file instead of spooling to the print queue. Of course, if you specify the -s flag, you can't modify or delete the original file while it's printing, but this option can save a bit of time (since no copy is made) when the original file is big.

3> Joining files

cat food   Display the food file on the screen.

cat scratch fever   Join the files scratch and fever and then displayt he result on the screen.

cat eats bird > DetailsAt11   Join the files eats and bird and save them in the file DetailsAt11.

4> Searching for files: find

5> Comparing files: diff

6> Task scheduling: at

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics