Skip to main content

Posts

Showing posts with the label command prompt

Ubuntu: Directory size from terminal

In this post we gonna see how to find size of a directory from Terminal. To summarise disk usage of each file, recursively for directories, we can use the following command du [option]... [FILE/Directory]... To get the report in human readable format, along with the overall summary, use du -hs /path/to/directory To find sizes of directories recursively unto a certain depth (e.g.: depth = 2): du -h --max-depth=2 /path/to/directory

Ubuntu: Proxy settings for Maven

Recently I faced problem using maven under a proxy network and by little research, found this solution. Temporary solution : Add the following options along with your maven command -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128 For example, to run "mvn package": mvn -DproxySet=true -DproxyHost= my.proxy.host -DproxyPort= 3128 package Permanent solution : To add the proxy settings permanently, goto {M2_HOME}/conf/settings.xml and find the <proxies> section. Un-comment the required sections and configure accordingly. To set proxy without password protection, change it as follows: <proxies>    <proxy>       <id>optional</id>       <active>true</active>       <protocol>http</protocol>       <host> proxy.host.net </host>       <port> 80 </port>  ...

Ubuntu: Recent command history (terminal)

Hello guys, In this post I'm gonna show you "How to display and play with a list of recent commands in Ubuntu?". To check history of command or to get info about command executed by user, we can use the following command: history It will display the list of all the command executed, along with a serial number indiacating the oerder in which they are executed. Now you may feel it dificult to find a specific command among them. In order to do so, we can combine the history with grep. history | grep version This will display a list of command in which the word "version" has appeared. We can also execute a specific command by knowing its serial number from this list. After getting the result from history command, just type the number preceeded by ! to execute the command. To execute command which is at number 115 in the list, just type !115 It will run the 115th command in the history list. To re-run a recent command that starts with xyz, just ty...

Dial-up connection using Command prompt

Connecting to internet using mobile partner or some other program is simple. But it consumes your system resources(around 200 MB of RAM). You can simply save your resources by using command prompt. This method is applicable only on Windows platform. First, install the device driver and create the dial-up connection, or just install the mobile partner(or software that came along with your modem) and connect using it(it will automatically create the dial-up connection). now you can exit that program. Here is the procedure to connect using command prompt: Open command prompt Type the following command rasdial "CONNECTION NAME" Ex: rasdial "TATA DOCOMO INTERNET" To disconnect, rasdial "CONNECTION NAME" /Disconnect You can also automate this process by creating batch file. Connect Open any text editor and copy the following code :Redial rasdial "CONNECTION NAME" if %errorlevel% == 0 exit goto Redial; Replace the CONNECTI...

Logout using terminal / command line

If you ever find it difficult to find the logout button(sometimes happens - out of screen), run this command /usr/bin/gnome-session-save --logout or /usr/bin/gnome-session-save --force-logout