Check These Out
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
Find if $b is in $a in bash
Warning: Instead of immediately updating as soon as updates are available, users must recognize that due to the nature of Arch's rolling release approach, an update may have unforeseen consequences. This means that it is not wise to update if, for example, one is about to deliver an important presentation. Rather, update during free time and be prepared to deal with any problems that may arise.
Pacman is a powerful package management tool, but it does not attempt to handle all corner cases. Read The Arch Way if this causes confusion. Users must be vigilant and take responsibility for maintaining their own system. When performing a system update, it is essential that users read all information output by pacman and use common sense. If a user-modified configuration file needs to be upgraded for a new version of a package, a .pacnew file will be created to avoid overwriting settings modified by the user. Pacman will prompt the user to merge them. These files require manual intervention from the user and it is good practice to handle them right after every package upgrade or removal. See Pacnew and Pacsave Files for more info.
Tip: Remember that pacman's output is logged in /var/log/pacman.log.
I often need to extract a function from a bash script and this command will do it.
Advanced revision to the command 8776 . This revision follows symbolic links.
The quotation-marks surrounding $(which $1) allows for graceful handling of errors ( ie. readlink does not complain incase 'which' command generates (null) output)
the -A argument forwards your ssh private keys to the host you're going to. Useful in some scenarios where you have to hop to one server, and then login to another using a private key.
I changed my shell to screen by editing .bashrc, this stopped scp from connecting.
Adding two tests before screen fixed them problem.
Redirect the local port 2000 to the remote port 3000. The same but UDP:
$ nc -u -l -p 2000 -c "nc -u example.org 3000"
It may be used to "convert" TCP client to UDP server (or viceversa):
$ nc -l -p 2000 -c "nc -u example.org 3000"