The command-line is the interactive interface to your shell.

learn more… | top users | synonyms (1)

15
votes
2answers
1k views

How do I create a test file with lots of zero bytes

I know how to create an empty file: touch /var/tmp/nullbytes but how can I create a 1MB file that only contains nullbytes?
-2
votes
2answers
115 views

How to handle binary data in Linux [closed]

One of the my servers gives me data with Content-Type: application/binary, i.e data that I am getting looks like some alien data. Now I need to convert that data into plain data, but I am not aware ...
0
votes
1answer
97 views

Current IP address as visible from the internet? [duplicate]

I know I can get the locally assigned IP address of my current machine by the local router like so: ifconfig However, I want to know what my IP address is as visible from the outside world. Or, in ...
1
vote
1answer
236 views

Get the current volume level in OS X Terminal CLI?

I would like to check the current volume level from the CLI on my Mac. I know I can set it like this: osascript -e 'set volume <N>' But that doesn't seem to work when trying to get the ...
2
votes
1answer
114 views

Navigating the CLI: Go back N words

I'm a Vim user, so I'm learning Emacs commands for use in the Bash CLI. I know that on my systems I can use Vim-keybindings in Bash but I'd like to learn how to use it effectively in its default ...
3
votes
2answers
101 views

What is “Exit 2” from finished background job status?

I have an exercise to put in a file some data (*conf from some directories) and need to do this in background. I did it and I am wondering what is the meaning of output messages: [A@localhost tests]$ ...
1
vote
3answers
299 views

How to execute same command “X” multiple times with a time delay of some number of seconds? [duplicate]

I know how to execute multiple commands at same time but now what I need is to run the same command multiple times with some time delay between the command execution. Requirements I don't want to ...
1
vote
1answer
35 views

Make terminal print name of parent process OSX [closed]

Slightly above n00b, but not by much. I made an alias to search for and display all of the processes associated with a specific user account that seem to auto initiate every time I log in, which are ...
1
vote
2answers
77 views

Using globbing/wildcards when Opening Files from Terminal

I have a folder A. Inside the folder, there are some files a,b,c,d and there is a subfolder, B, containing files e,f,g. Suppose I want to open files a,b,c,d: then I just type xdg-open *. However, ...
1
vote
3answers
76 views

Generate File of a certain size?

I'd like to generate a file with the name example.file. I could use touch example.file but I want the file to be exactly 24MB in size. I already checked the manpage of touch, but there is no ...
2
votes
2answers
44 views

Proper escape sequence for a non-standard file name [duplicate]

I'm trying to remove a file I made by mistake using --exclude with tar. I ended up making a tar file named --exclude=*.tar Now I want to delete it but I'd like to rename it first. How do I escape it ...
1
vote
1answer
85 views

Command(s) to install tempfile on CentOS 6.4

I'm looking to install the package for tempfile but am not finding it? possibly use mktemp but I'm not sure if there is a difference in behaviour besides a dot notation in the temp name? $ tempfile # ...
0
votes
1answer
102 views

what does the following command do?

what does the following command do? I have tried to study the linux command but I could not find out what this command does. here is the command: touch finger ; finger touch
5
votes
3answers
127 views

Robustly segmenting a csv file containing noisy data

Say I have a csv file with these columns: timestamp,cpu,memory An example of the shape of the actual data would be this chart: Having the data visualized in this way, it's easy for the human eye ...
-1
votes
2answers
86 views

How to install Okular under SUSE (on a server)?

I would like to install the pdf viewer Okular on a SUSE Linux Enterprise Server 11. I am familiar with apt under Ubuntu, but on SUSE, I only found rpm to install .rpm files. I am wondering how Okular ...
1
vote
0answers
27 views

How can I specify an executable path that will work from any working directory? [closed]

I have a java process that runs in this directory: /home/zookeeper/zookeeper-3.4.5/org/zookeeper/Process.class That Java process will in turn launch another Java process that lives here ...
2
votes
1answer
88 views

What is the meaning of the .: in this linux statement?

Somebody helped me run a java program with the following (working) line of code. The zookeeper-3.4.5.jar exists in the working directory. What it is the meaning of the .: syntax here? Does that just ...
4
votes
1answer
104 views

Can I pipe lpt port over tcp?

I'd like to pipe data in and out to a lpt (parallel IEEE 1284) port on another machine, to remotely use a device. Can it be done in a common unix-y system? I have ubuntu 12.04. :) I was thinking ...
1
vote
4answers
144 views

Is there a difference between ./script and bash script?

Given a shell script file that begins as #!/bin/bash # (bash script here), and has been chmod +xed, is there any difference in running ./script and bash script from the command-line?
0
votes
1answer
301 views

Script for running sequential job

I started recently to learn using Linux. I want to write a script in bash shell to run a serial job on a cluster. I have been searching for hints and instructions on how to write such a script. I ...
1
vote
3answers
561 views

Count tabs per line in text file with utils

I have a tab-tabulated file. I would like to check if every line has the same number of tabs. For first step, I'd like to print the number of tabs for each individual line. I've tried grep -o '\t' ...
0
votes
2answers
78 views

Using Pipeline to Direct Files to Program that Opens Them

I have a Music folder, in which I have some music tracks, which aren't organized too well. Thus, if I want to find a particular track, I usually type: ls Music | grep <keyword>, where ...
2
votes
2answers
138 views

How can I uninstall packages from the command line on Ubuntu?

I am wondering how one would uninstall software from the command line/terminal. What commands would I use?
1
vote
1answer
5k views

Linux shell - Sending messages to another user

Is there any command to send messages through the Linux shell to other people on the same network? I'm using write user and then write the message itself. But there's any command that doesn't show my ...
2
votes
2answers
266 views

How to write text into the first line of a file?

I've been looking around sed command to add text into a file in a specific line. This works to add text after line 1: sed '1 a\ But I want to add BEFORE line1. It would be: sed '0 a\ but I get ...
3
votes
1answer
149 views

What does 2>&1 in this command mean? [duplicate]

I understand that this command attempts to write to nowhere or a null device but what does 2>&1 mean here? wget -q -O - http://yourwebsite.com/wp-cron.php?doing_wp_cron > /dev/null ...
2
votes
2answers
96 views

Run last line of error message as a command

If you were trying to run a package that is not installed, for example: me ~: gparted The program 'gparted' is currently not installed. You can install it by typing: sudo apt-get install gparted ...
0
votes
1answer
71 views

How to start “Shape collage” application from terminal

I just installed application "shape collage" on my Archlinux, but I don't know how to start it via the terminal. Command shape-collage doesn't seem to work.
2
votes
2answers
65 views

What is the meaning of this error: example: Is a directory

I'm trying out fuse with this tutorial. When I try to run the example using the command below, I get this error: memsql@memsql-virtual-machine:~$ ~/fuse-2.9.3/example> ./hello /tmp/fuse -d bash: ...
1
vote
2answers
105 views

How to use `ls` to group and show only a first word of directory name?

I want to define a new ls command to do something like this The first when i use ordinary ls command: $ls undergrade.AI undergrade.KDD undergrade.AI2 undergrade.micro ...
2
votes
0answers
71 views

Xorg Setting checking from Command Line

How do I determined, whether Xorg is using Xinerama, DDC and Reduced Blanking ?? Just adding few options in Xorg.conf is sufficient ? If I have to check from command-line, then how can I check ...
1
vote
3answers
78 views

Terminal: Use different command on previous file

I know that there is the !! command to reuse the previous command. How would one reuse the file or directory specified in the previous command but use a different command on it? Example: I want to ...
3
votes
2answers
379 views

Why does Bash history not record this command?

The command printf "#!/bin/bash\n" > t generates an error(bash: !/bin/bash\n": event not found), but hitting the up key does not recall the command so that I can modify it. Why is that? (What I ...
3
votes
2answers
171 views

Create Zip for each subfolder but containing only matched files

I am trying to figure out how to create a zip file for each subfolder containing only files that match my criteria. For instance I have: Folder1 Folder2 Folder3 Each folder contains the same set ...
0
votes
2answers
220 views

How to unpack a downloaded tar.bz2 archive?

I downloaded YOONO-Desktop from http://www.yoono.com/, and I try to install it with the following steps: [root@localhost mpatil]# tar xfv yoono-destop-1.8.43.tar tar: yoono-destop-1.8.43.tar: Cannot ...
1
vote
2answers
245 views

Need to copy files to existing directory and remove files already there with the same name but different extension

EDIT: Total rewrite of question for clarity. I have a directory tree (new) with a bunch of files of with an extension of .new. I have an identical tree (old) where many of the files have names ...
4
votes
3answers
258 views

OS X/Linux one-liner/script to find the largest recurring group of lines in a text file?

I have a log containing an execution trace where there is infinite recursion eventually terminating when the stack is too deep. There are enough lines and valid included recursion within the larger ...
4
votes
3answers
317 views

rlwrap: mysql autocompletion not working

Normally, autocompletion works fine in mysql command-line client (mysql-client-5.5). I have a table called booking. When I type the letter b and pres TAB the name of my table gets autocompleted: ...
0
votes
1answer
82 views

Am I running Bash?

I am using OS X 10.8.5. I am trying to figure out if the terminal is running bash. When I type in the following it says "getent" command not found -- but the error message seems to be coming from ...
0
votes
1answer
66 views

How can I get sublime text to run from the command line?

I am trying to get sublime text to run from the command line using this tutorial. It says to run this command: ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl ...
0
votes
1answer
148 views

What command will generate average lines per minute?

I'd like to know how many average lines are written to a file per minute. Could someone help me with a command or code to generate this number?
0
votes
0answers
27 views

How to use grep command to find the matching pattern and some more characters? [duplicate]

I have a compressed JS code and I want to find a pattern, but since the file is compresses, it has only a line, and the match pattern is all the file. The output is too much large. grep -r ...
0
votes
2answers
163 views

how to run .dump command in linux? [closed]

I want to create dump file of sqlite database from java but I can't run the below command from linux. I got the help of windows and I tried with linux but it appears one terminal nothing more than ...
4
votes
1answer
218 views

Is there a command such as xwininfo, xdpyinfo, xprop, or xlsclient that will tell me what font an X client window is using?

I'm trying to find a command that will report what font a given X window is configured to use. Does such a command exist? Looking through these tools I did not see an option that would give me this: ...
3
votes
3answers
186 views

What is a “non-option argument”?

I am trying to understand info who but completly fail at the term »non-option argument«. Can someone please explain this term to me in simple words or an example? UPDATE: from ' info who' ...
4
votes
2answers
2k views

Connect to a Bluetooth device via Terminal

I'm using Mint 15 w/ cinammon. I bought a set of bluetooth speakers and i'm tring to connect to them via terminal. Via GUI i can see them normally and i am connected to them. I want to make a small ...
2
votes
1answer
46 views

Piping fragments of a document through various commands

I want to send, maybe using escape sequences such as $$$, fragments of an article through various commands, possibly with modifiers. The stdin would be replaced by the corresponding stdout. (Deleting ...
2
votes
1answer
61 views

Obtaining XWindows GUI menu item/widget names from the command line

I have just learned about dogtail, and it can allow enumeration of menu items/widgets of a GUI application from the command line; for instance (via Testing/Automation/DogtailTutorial - Ubuntu Wiki): ...
3
votes
3answers
170 views

Command line options of rackup are not shown in ps output or procfs

As you know if you wish to get command-line runtime arguments for running command you can parse ps -e or /proc/<pid>/cmdline. But I have encountered issue when this method returns only command ...
1
vote
1answer
121 views

How can I finding the Modify/Access/Change time of a file or directory? [closed]

I am using Debian 7.2 and would like to know the shell command for finding the MAC time of a file or directory. I tried man -k "MAC" and got a lot of hits about macros. I then tried man -k "MAC ...