Jump to Navigation

command

198 - rm: cannot remove

When you try to delete directories & files, If you have the errors, even though you have a write permission.

rm: cannot remove `./data/test.txt': Permission denied
rm: cannot remove directory `./data/files': Permission denied

1. chmod the permission on those.

Linux:

197 - iostat

The iostat command is used for monitoring system input/output device loading by observing the time the devices are active in relation
to their average transfer rates. The iostat command generates reports that can be used to change system configuration to better balance
the input/output load between physical disks.

iostat is part of the sysstat package, so go ahead and install it :

Linux:

194 - System Upgrade for ubuntu

1. Install newest version of packages on a machine

This command installs the latest versions of any out-of-date packages on your system. It never installs a package
that is not yet installed.

# sudo apt-get upgrade

2. Upgrade all packages on the system.

This command installs up-to-date version of packages, and may install additional packages.

Linux:

192 - Search Open Ports for Linux Server

1. nmap Command.

# nmap 192.168.17.1
# nmap 127.0.0.1

2. nd Command.

# nc -z 192.168.10.61 1-1023

Run nc command with -z flag. You need to specify host name / ip along with the port range to limit and speedup operation.

3. Close a port

Linux:

187 - Java Decompiler (Jad)

Jad (Java Decompiler) is a decompiler for the Java programming language. Jad provides a command-line user interface to extract source code
from class files. A graphical user interface for Jad is JadClipse which is a plugin to the Eclipse IDE.

< Install jad >

1. Download jad158e.linux.intel.zip for RedHat

URL:   http://www.varaneckas.com/jad

2. Unzip jad.zip file into any appropriate directory on your hard drive.

Linux:

186 - Expect Command Tool

Expect is a tool for scripting interactive command-line tools.

In general, Expect is useful for running any program which requires interaction between the program and the user. All the interaction can be
characterized programmatically. Expect can also give the user back control (without halting the program being controlled) if desired.
Similarly, the user can return control to the script at any time.

Linux:

181 - To show top10 CPU & Memory utilization

  • Top 10 CPU utilization
# ps -e aux | sort -r -k 3 | head -n 10
  • Top 10 Memory utilization
# ps -e aux | sort -r -k 4 | head -n 10

If you do not need a header, please add the following option.

ps --no-header

 

Linux:

178 - zip, tar compress utilities

1. zip

Zip is probably the most commonly used archiving format out there today. Its biggest advantage is the fact that it is available on all operating system
platforms such as Linux, Windows, and Mac OS, and generally supported out of the box. The downside of the zip format is that it does not offer
the best level of compression. Tar.gz and tar.bz2 are far superior in that respect. Let’s move on to usage now.

To compress a directory with zip do the following :

Linux:

174 - Kill User Session

1. To kill a specific user session :

# who --all

# ps -ef | grep 5304

# kill -9 5304

2. To kill a process :

# pgrep -f 'zsh'

# pgrep -f 'process name' | xargs kill

3.To kill gnome sesssion :

Linux:

172 - Useful Command for IP & Network Card

Display Current Config for all NIC's : ifconfig

Display Current Config for eth0 : ifconfig eth0

Assign IP : ifconfig eth0 192.168.1.2

Ping : ping -c 3 192.168.1.1

Assign multiple IP's : ifconfig eth0:0 192.168.1.2

Assign second IP : ifconfig eth0:1 192.168.1.3

Disable network card : ifconfig eth0 down

Enable network card : ifconfig eth0 up

Linux:

Pages

Subscribe to RSS - command


Main menu 2

by Dr. Radut