grep is a command-line utility that allows searching of words and/or patterns in a file or group of files. Its name comes from the ed command g/re/p (globally search a regular expression and print). Grep does a global search by keyword or regular expression and print all matching lines on the standard output.
Regularly I use ps ax | grep pattern to get information about a particular process, but in the oupout the grep process is shown, how to avoid this?
Simply encloses within square brackets the first letter or number of the pattern, for example:
Desktop like GNOME, KDE, XFCE, LXDE have a task manager that allows you to terminate a process using the graphical interface, but not always we have managers like these or we simply work without graphical interface (server) and we need to kill a particular process because it does not respond to any action, and that's when should lend hands to the console
To run a remote command on GNU/Linux or another UNIX variant, you must be able to access the remote server through ssh
In order to run the remote command type:
$ ssh servidor-remoto command
In the GNU/Linux world, it is common to use lowercase characters to identify files and directories, to illustrate the above we show the DIRs that are found under the /etc/apache2 DIR on Debian GNU/Linux
/etc/apache2/ ├── conf-available ├── conf-enabled ├── mods-available ├── mods-enabled ├── sites-available └── sites-enabled
so if you have one or several DIRs in uppercase or lowercase and uppercase at the same time and for uniformity want to all be lowercase then you can rely on the following script.
To use the script download here
Set execute permissions
chmod a+x tolower.sh
Run the script
- man find
- man tr
We can get CPU information in GNU/Linux by typing the following command:
$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 22 model name : Intel(R) Celeron(R) CPU 430 @ 1.80GHz stepping : 1 cpu MHz : 1800.045 ...
One of the easiest and safest ways to find duplicate files on GNU / Linux files is using the tool fdupes, fdupes find duplicate files comparing the file sizes, making a check MD5 followed by a byte to byte comparison.
Debian/Ubuntu and derivatives
$ sudo apt-get install fuseiso
# yum install fuse-iso
$ fuseiso -p my.iso access-point
access-point = DIR where you will mount the image
Unpack .iso with 7-Zip
– man fuseiso
7-zip is a file compressor with a high ratio of compression. The main features are:
- High ratio of compression (LZMA algorithm)
- Compress / decompress: 7z, ZIP, GZIP, BZIP2 and TAR
- Unzip: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z
- Robust encryption: AES-256 for 7z and ZIP formats
- Allows to create self-extracting archives (SFX)
- Command line version
- Integration with File Roller, XArchiver and XArchive
If when you try to unpack a file .tar.bz2, you get the following error messages:
tar (child): bzip2: Cannot exec: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2
You must solve it by installing the bzip2 package
# apt-get -y install bzip2
– man tar