Jump to Navigation


280 - CUPS Cancel Print Jobs

If you are using CUPS, sometimes you want to cancel some print queues. So "lprm" is a useful command for that.

lprm will remove a job, or jobs, from a printer’s spool queue. Since the spooling directory is protected from users, using lprm is normally the only method by
which a user may remove a job. The owner of a job is determined by the user’s login name and host name on the machine where the lpr(1) command was invoked.

 lprm [-Pprinter] [-] [job # ...] [user ...]

Options and arguments :

Shell Script:

232 - diff and patch for Linux

The commands diff and patch form a powerful combination. They are widely used to get differences between original files and updated files in such
a way that other people who only have the original files can turn them into the updated files with just a single patch file that contains only the differences.

1. Create a patch

The most simple way of using diff is getting the differences between two files, an original file and an updated file.

Shell Script:

200 - Bash if statement conditions

1. and, or

You can use "-a" or "&&" for and and "-o" or "||"for or

if [ [ condition 1] -a [ condition 2] ]; then
  [ Execute if both are true. ]
if [ [ Condition 1] -o [ Condition 2] ]; then
  [ Execute if either is true. ]

* Sample

Shell Script:
Subscribe to RSS - command

Main menu 2

by Dr. Radut