Check These Out
The download content part.
NOTE: the '-c' seems to not work very well and the download stuck at 99% sometimes. Just finish wget with no problem. Also, the download may restart after complete. You can also cancel. I don't know if it is a wget or Rapidshare glitch since I don't have problems with Megaupload, for example.
UPDATE: as pointed by roebek the restart glitch can be solved by the "-t 1" option. Thanks a lot.
In this way it doesn't have problems with filenames with spaces.
expand to:
cp /work/host/phone/ui/main.cpp /work/target/phone/ui/main.cpp
!#
The entire command line typed so far.
Waits for all pings to complete and returns ip with mac address
Extracts only file number 12 from file. It's meant for text files. Replace 12 with the number you want.
First line starts at 1 not 0.
We use q on next line so doesn't process any line more.
This will perform one of two blocks of code, depending on the condition of the first. Essentially is a bash terniary operator.
To tell if a machine is up:
$ ping -c1 machine { echo succes;} || { echo failed; }
Because of the bash { } block operators, you can have multiple commands
$ ping -c1 machine && { echo success;log-timestamp.sh }|| { echo failed; email-admin.sh; }
Tips:
Remember, the { } operators are treated by bash as a reserved word: as such, they need a space on either side.
If you have a command that can fail at the end of the true block, consider ending said block with 'false' to prevent accidental execution
create and md5 sum of your password without it showing up in your terminal or history.
Afterwards we overwrite the $p variable (thx to bazzargh)
Oracle DBA remove some logfiles which are still open by the database and he is complaining the space has not been reclaimed? Use the above command to find out what PID needs to be stopped. Or alternatively recover the file via:
$ cp /proc/pid/fd/filehandle /new/file.txt
just use a space to prevent commands from being recorded in bash's history on most systems