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

learn more… | top users | synonyms (1)

3
votes
2answers
72 views

Repeated commands in a bash pipeline

Sometimes commands repeat in pipeline command. For example (just to illustrate): $ grep -lF 'pattern' ./foo/**/*.bar | xargs dirname | xargs dirname Is there a way to shorten chaining command? For ...
9
votes
4answers
12k views

How can I kill a particular thread of a process?

$ ps -e -T | grep myp | grep -v grep 797 797 ? 00:00:00 myp 797 798 ? 00:00:00 myp 797 799 ? 00:00:00 myp 797 800 ? 00:00:00 myp This shows the process ...
1
vote
1answer
85 views

Is there a graphical shell or scripting environment for Linux?

I would like to draw my scripts and connect commands like blocks of functions (something similar to Yahoo Pipes). Does such an environment exist or do I have to develop it myself?
18
votes
2answers
515 views

Is there a reason why ls does not have a --zero or -0 option

This question was prompted by questions about ls' -1 option and the recurring tendency of people to ask question and answers that includes processing the output of ls. This reuse of the output ls ...
2
votes
3answers
310 views

Copy files without encryption (ssh) in local network

scp works well in all cases, but the Raspberry Pi is to weak to copy files efficiently in a secure environment (lan). The theoretically possible 6,75 MB/s via 54 Mbit wireless lan shrink down to about ...
15
votes
1answer
1k views

copy (to X clipboard) shortcut in .tmux.conf

In order to copy text to X clipboard in tmux, what I currently do is: go selection mode with prefix[ start selection with space (using mode-keys vi btw) select the text and press enter copy tmux ...
6
votes
5answers
741 views

How does one find out how many bits a file has in one command?

I know I can use ls -lat to find out how many bytes has a file and then multiply by 8 to find out how many bits. But is this possible in only one command line?
3
votes
2answers
84 views

Get list of subdirectories which contain a file matching a string

How can I get a list of the subdirectories which contain a file matching a particular string? More specifically, I am looking for directories which contain a file with the letter 'f' somewhere ...
0
votes
2answers
86 views

Simplest wget example Scientific Linux

I'm on Sci Linux and know nothing about commands. How can I use the wget command? Can someone provide a simple example where it actually downloads something? How do you specify where the download ...
0
votes
3answers
138 views

Awk/grep/sed get comma separated list of numbers from lines of text

I have a log file that has lines that look like this: blah blah blah Photo for (702049679 - blah blah blah Now I know I could get all the lines like that from the file by doing: grep "Photo for" ...
2
votes
2answers
132 views

How do I share stdout between multiple processes?

I want to receive live TCP stream, and make it readable by another processes at the same time, without saving it. For example, 111.222.233.244:1234 streams actual time. Server supports only one ...
2
votes
1answer
67 views

Byobu - send command to byobu tmux session from commandline (or bash/sh)

I run a script which I would like to print the status to a byobu tmux session. So for example print backup finished \n. Is it possible to do this with the name of the byobu tmux window, which you can ...
2
votes
1answer
68 views

cat file to multicast

I have a text file (test.txt) which represents captured network data. The actual protocol is text-based, with NULL line endings, so this isn't a problem. I need to run this test captured data ...
2
votes
3answers
29 views

setting up script in a linux machine for scientific computation [closed]

I'd like to setup machine for test some computation in my old laptop, before replicate the tests on the server. The computation will be image-processing and machine learning, run some program, load ...
0
votes
1answer
42 views

What is the different bash per terminal session for Konsole?

I am using Konsole in Kubuntu. I was wondering what is the difference between a profile in Konsole and the profiles in our bash? I am reading that we can create different profiles per Konsole session ...
5
votes
3answers
4k views

Storing output of command in shell variable

I have an operation using cut that I would like to assign result to a variable var4=echo ztemp.xml |cut -f1 -d '.' I get the error: ztemp.xml is not a command The value of var4 never gets ...
1
vote
2answers
312 views

Error Installing “ia32-libs” to run ADB and Fastboot Linux Mint 16 “Petra”

I have been trying to get adb, fastboot, avd and others to work with the latest version of Linux Mint (16 "Petra") I originally got this error when trying to run ADB: ➜ platform-tools ./adb ./adb: ...
1
vote
1answer
593 views

can't wget rpm oracle on centos linux

Forgotten how I did this last time. Tried the following 2 methods that I thought had worked for me in the past: method #1 $ wget \ ...
1
vote
2answers
75 views

Convert a date format

I have one problem with my date format. I want to change from one format to the other and vice verse. My date formats are: Format1 : 1/24/2014 Format2 : Jan 24 How can I do this?
1
vote
4answers
1k views

How to send many commands to shell and wait for the command behind ends

Hello I have around 20 commands and I have to send all of this to Unix shell, and copy the result, but I don't know how to do it. I am not sure about what shell I have, because it is a small program ...
0
votes
2answers
90 views

Using notify-send with a non-interactive ssh connection

I want to be able to use notify-send to send popup messages from one server to be displayed on another. I'm sure this is possible with SSH, but how can I automate it to a one-line command that ...
3
votes
2answers
66 views

Edit tree to output in custom format?

I'd like to get a custom output from the tree command, but unlike this question, I don't have a fixed format. I'd like to be able to give the command the format in an argument (for instance perhaps ...
14
votes
2answers
785 views

Is it harmful to close a terminal window without properly exiting an application?

Using Ubuntu 12.04 LTS, my question is that if I started an application in a terminal window, then is there anything bad about just closing the terminal window without exiting the application properly ...
2
votes
2answers
701 views

Home key not working in terminal

I am using GNOME Terminal 2.7.3 and zsh 4.3.9 (x86_64-unknown-linux-gnu) Home and End are not working. Nothing happens and nothing gets displayed when I press them. but they work when I press shift + ...
2
votes
3answers
57 views

Sed - string substitution with groupings

I have a largish directory with filenames formatted like Some_Folder-(FOL001)-clean what I'm trying to do is display the pattern between the brackets at the start like FOL001 ...
0
votes
2answers
53 views

Where are netstat's -t and -u flags documented?

I use the following command to find open ports on my servers: $ netstat -ntulp I've probably found that on some random website over the years. However, I cannot find where -t or -u are documented. ...
-4
votes
4answers
122 views

How can I `man print`?

Where can I find more information about the command(?) print since I don't receive a result when I input man print? For example, in the zsh I can do the following: $ print "Hello, world\!" Hello, ...
0
votes
2answers
62 views

How do I prepare Windows NTFS drives on Linux

I'm upgrading my windows desktop hardware and doing a clean OS install. I'm using SystemRescueCD to prepare my old drives for the upgrade. Long story short, a bit of an emergency, I coudln't do this ...
0
votes
1answer
195 views

Delete all 'nohup.out' within a directory recursively

How can I delete all 'nohup.out' files within a directory recursively from my terminal? I'm using CentOS.
0
votes
1answer
56 views

Why date +3 equals 3?

Yes, this is a minor issue, but I wonder why date +3 outputs 3 Other options like: date -3 raise an error.
0
votes
0answers
17 views

how to invoke fonts dir in ghostscript

I am trying to create a PDF out of a text file with Courier as font and trying to use gswin32c.exe on Windows, but unnable to pass parameters correctly, I think. The gswin32c.exe is the Windows exe of ...
4
votes
2answers
258 views

What does `du - hb` do?

With du -bh I think I get the apparent size in human readable format: # du -bh 295K ./test However, I would expect the same from du -hb, but I get something else: # du -hb 301926 ./test I ...
1
vote
1answer
58 views

Why doesn't setuid on /sbin/dhclient work as intended?

I am the only user on my machine, and prefer not to type sudo every time I use dhclient. Therefore, I tried sudo chmod u+s /sbin/dhclient. However, when I subsequently run dhclient wlan0 from a ...
-1
votes
4answers
69 views

Need a command sequence that will move files from one directory to another based on a particular year? [closed]

I'm looking for a sequence of commands (one liner would be ideal) which will identify all the files created in particular year, and move the resulting files to another directory.
2
votes
2answers
183 views

get age of given file

How can I get the age of a given file in, at least, days? I'm well aware of ls -lh and similar commands. I want something that will work sort of like this: getfage <FILE> # prints out '12d' ...
1
vote
2answers
225 views

Ignore “other” domains when downloading with wget?

I would like to crawl links under www.website.com/XYZ and only download the links that is under www.website.com/ABC. I am using the following wget command to get the files I want: wget -I ABC -r -e ...
5
votes
2answers
95 views

How can I parallelise the upload of a directory by FTP?

I need to upload a directory with a rather complicated tree (lots of subdirectories, etc.) by FTP. I am unable to compress this directory, since I do not have any access to the destination apart from ...
3
votes
4answers
3k views

Show files from the last 2 days on a mounted ntfs system?

What's exactly the command to show files younger than 2 days? I thought about something like this: $ find / -mtime -2 ...but I'm not sure how to print the date of the found files. My target is to ...
2
votes
2answers
51 views

Copying recursively files with spaces

At the moment I have a set of files of the form of: /dir one/a picture.jpg /dir two/some picture.jpg What I want to do is copy and change the end to -fanart.jpg to the filename to: /dir one/a ...
1
vote
4answers
113 views

How to start line with command from output of another command

Sometimes the output of some command include other commands. And I'd like to start that command from output without using a mouse. For example, when command is not installed there is a message with ...
13
votes
7answers
5k views

diff within a line

I have some sql dumps that I am looking at the differences between. diff can obviously show me the difference between two lines, but I'm driving myself nuts trying to find which values in the long ...
1
vote
2answers
63 views

How to asynchronously launch external program from cli and discard its output?

I'm writing a simple desktop initiation script which waits for disk idle, and then launches next external program (like Firefox, Skype or conky) using &, like: ps cax | grep conky > /dev/null ...
2
votes
3answers
51 views

How to start first command from the list printed by command 'history | grep something'

For example, I have the following output from command: loom@loom:$ history | grep MAKE 219 ../build.sh -DCMAKE_BUILD_TYPE=Debug .. 909 history | grep MAKE How to write a command, that start ...
8
votes
3answers
139 views

Clear / erase a mistyped password in a terminal

One thing that annoys me using Linux's terminal is when I have to type a invisble password, like when you run ssh the terminal I was wondering if there's a way to clear/erase the invisible password ...
1
vote
2answers
183 views

Convert image with imagemagick command line convert tool

I have an image Image.png. How do I use the ImageMagick command convert to make this file into a Image.jpg file with the following requirements: File size is 200~500 kb. Resolution in not less than ...
5
votes
2answers
129 views

Processes do not respond to my signals

I have a strange behavior on my system. When I invoke a command in the shell (bash version 4.2.45(1)-release), say top or cat, the running program (the process) does not respond to Ctrl+C. I even ...
0
votes
4answers
121 views

Can I have the shell ignore the command line sometimes but not always?

For debugging purpose sometimes I access a remote Linux box via VNC. At that time someone else may be working on that same Linux box through VNC and it may happen that I do not have facility to chat ...
2
votes
0answers
28 views

Can “grub-emu” make any changes to my system?

Can "grub-emu" make any changes to my system? I understand that the command "grub-emu" opens a GRUB emulator. However, since it loads the configuration files used by the "real" GRUB, I am a little ...
2
votes
1answer
210 views

Processing shell script options with awk

I'm looking for way to process shell script arguments that is cleaner and more "self documenting" than getopt/getopts. It would need to provide... Full support of long options with or without a ...
1
vote
1answer
86 views

fg a bg process because you forgot to redirect output to /dev/null

I did Ctrl+Z bg with the intention of disowning next, but I forgot to redirect, now I cant get to my terminal because the scrolling of the output (tarballed a huge directory with verbose set). How do ...