Skip to content
Advertisement

Tag: command

Save Directory Specific history for zshell

I am trying to save my directory specific command line history. AKA, when I am in a directory called Happy, and I arrow up, I don’t want to see all of my past command line history, I only want to see the history that was done in the specific Happy directory. I also want all of this to get saved

How to get lines of a file with exactly 3 characters in Linux

I need a command to find the lines of a file that have 3 characters. I do the command wc -w field.txt to list how many lines, but now I need to know the lines with 3 characters, exactly. Answer This will count (-c) the number of lines which match the regex (-E) “^.{3}$”, which is “start of line, exactly

SCP gives “File or directory not found”

I am having an issue. I am using the SCP command to transfer files from my desktop of my mac osx too my virtual server. The thing is I ran the command and successfully transferred one file from my desktop over to the server, no problem. So i use the same command which is: scp filename_I_want_to_transfer user@serverip: So basically that

System commands in c#

Does C# have an equivalent to the system command in C? for example, how would I do this in c#?. I’m using Mono on Linux. Answer No problem I got it. Tested and working on Ubuntu 13.10

Linux command for public ip address

I want command to get Linux machine(amazon) external/public IP Address. I tried hostname -I and other commands from blogs and stackoverflow like and many more. But they all are giving me internal IP Address. Then I found some sites which provides API for this. Example : curl http://ipecho.net/plain; echo But I don’t want to rely on third party website service.

How do I do a one way diff in Linux?

How do I do a one way diff in Linux? Normal behavior of diff: Normally, diff will tell you all the differences between a two files. For example, it will tell you anything that is in file A that is not in file B, and will also tell you everything that is in file B, but not in file A.

Equivalent lsof -i in Solaris

I have a fast question. I want to know what is the losf -i equivalent command in a Solaris system. I only want to show the files with network connection. Thank you!! Answer Here is a shell script that list all processes having open TCP or UDP ports on Solaris, you can limit it to a given port number by

Command Line to find and delete Similar files in Linux

I want to find and delete all the “similar files as shown below” recursively from the specified directory of my Linux Server by Using COMMAND LINE…. “file.php?p=10&file=load%2Fnew Animations 1%2FAwesome_flowers-(text1).gif&sort=0” “file.php?p=10&file=load%2Fnew Games 1%2FAwesome_flowers_-(text1).gif&sort=1” Note: All these files having different file sizes and The mathed text is in all files is “file.php?p***” Answer This should help you to delete files recursively.. find

Get the MySQL path

I tried googling to get the MySql path, but it was unsuccessful. Is there a unix command, where I can find the MySQL database directory path? Answer Try this query, SHOW VARIABLES LIKE ‘datadir’;

Advertisement