How to search for tab characters in a file?
Answer:
The most intuitive way to search for tab characters in a file
# expand file.txt | diff - file.txt
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to search for tab characters in a file?
Answer:
The most intuitive way to search for tab characters in a file
# expand file.txt | diff - file.txt
Modern way to show current IP address(es) in Linux
Answer:
In the past we already showed that you can get the IP information using the command "ifconfig", actually the modern way to do the job is
# ip a
1: lo: mtu 16436 qdisc noqueue state UNKNOWN
..
2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:26:5e:3e:42:d2 brd ff:ff:ff:ff:ff:ff
..
Get the ssh public key from private key file
Answer:
Sometimes, you want to generate the ssh public key from the private key, here is a simple command:
# ssh-keygen -y -f id_rsa
Securely remove files or directories in Linux
Answer:
Normally you would remove a file by using the rm command, but what if you want to make sure the file is removed securely which prevent other people from recovering it?
Use srm, e.g.
# srm confidential.txt
How to add a static route using command
Answer:
To add a static route, you can use a simple command like:
# sudo route add 192.168.15.0/24 192.168.1.1
The above command make all request to 192.168.15.0/24 (i.e. 192.168.15.1 to 192.168.15.254) route thru the gateway 192.168.1.1