The grep program is a standard UNIX utility that searches through a set of files for an arbitrary text pattern, specified through a regular expression. By default, grep is case-sensitive (use -i to ignore case). By default, grep ignores the context of a string (use -w to match words only). By default, grep shows the lines that match (use -v to show those that don’t match).
This is how mounting works
sudo mount /dev/*** /folder
sudo allows you to run special commands like mount
To check the system performance under linux you can use the “top” command.
Note: It is useful for monitoring the system performance.
Many Users who likes to work as root and but in TeamViewer 5 there is restriction for Running as root.
Whenever you are trying to run TeamViewer as root from Terminal, You will get message like below:
TeamViewer must not be executed as root!
By Following very few steps you will be able to run TeamViewer as root.
There are 2 ways to do this:
- Simply put the commands you want at /etc/rc.local
- Put your script in the /etc/init.d directory. After you make the script executable, use the following command to add the symbolic links: Code:
update-rc.d your_script_name defaults
If you ever want to remove the script from the startup sequence, use this: Code:
update-rc.d -f your_script_name remove
You might want to give a look at the update-rc.d man page for further options you can use with the command.
To ”’send”’ file or directory ”’to a remote computer”’:
scp -r [/path/filename] [login name@ip address] :
To ”’retrieve”’ file or directory ”’from a remote computer”’ ”’address in your pc”’:
scp -r [login name@ip address] : [/path/filename] [/path/filename]
Here are the meaning of scp command options:
-r — recursively copy entire directory
. — current directory
To copy all txt files in the current directory to your home directory on the destination machine:
scp *.txt 192.168.1.100:
To copy txt files to a destination directory. You have to have write permission on the target directory:
scp *.txt 192.168.1.100:/home/username/directory
To retrieve files from the other machine back to the one you’re on:
scp 192.168.1.100:*.txt /home/support/Desktop
How To Delete File Contents In Linux
I am sure you know that situation when you need to delete file contents in Linux. Just think about it – you have some log files on your Linux workstation or server, and their size just keeps growing and growing… Sometimes, it’s really necessary to delete the content of the file, but keep the file itself. So… how can you do that?
In Linux, deleting file content while keeping the file is quite easy! Just use the following command from command line:
cat /dev/null > YOURFILENAME
I recommend you to backup the file first, because you never know when something bad can happen
It happens alot that you have an IP device (ATA, door phone, …) and you don’t know the IP address. One easy way is to use nmap.
run this command (on linux of course):
$ nmap -sP <ip range>
eg: nmap -sP 192.168.1.2-50
make sure you run this as root otherwise it will show only ip address without the MAC
you can also save the output into a txt file this way:
eg: nmap -sP 192.168.1.2-50
You can also try using scanssh (next post will cover this)