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

learn more… | top users | synonyms (1)

3
votes
2answers
71 views

Tell gzip/bzip2/7z/etc not to compress already-compressed files?

I'm tarring up /home, and piping it through bzip2. However, I've got lots of already-compressed files out there (.jpg, .mp4, .mkv, .webm, etc) which bzip2 shouldn't try to compress. Are there any ...
1
vote
1answer
82 views

Service network restart same as ifup and ifdown?

Can service network restart take place of ifdown and ifup? I was managing my server the other day using SSH and I changed my internal IP from DHCP to static. After editing the config file I had to ...
0
votes
2answers
61 views

Tilde on unix:hpux and / or solaris

On Linux press F9 return a correct ~ On unix(solaris or hpux) return 0~ How to set correct tilde on those systems?
5
votes
2answers
213 views

ls -l /proc/self | increamental PID?

Each time, when the commandls -l /proc/self is executed, the link points to process who's PID keeps increasing. Why is this so ? Is it the PID of the ls command ?
-2
votes
2answers
41 views

What is a simple example where the use of the command line is unavoidable or better? [closed]

I want to see a simple example that motivates the use of the Linux command line. Like I want to see an example where the use of the command line will do it in seconds and on GUI , it will take you ...
1
vote
2answers
53 views

Formatting ifconfig using sed/awk

I'm using ifconfig on OpenSUSE. When I run ifconfig eth0 I get eth0 Link encap:Ethernet HWaddr CE:FD:75:DF:A5:6D inet addr:172.16.4.177 Bcast:172.16.5.255 Mask:255.255.254.0 inet6 ...
1
vote
2answers
41 views

Why does terminal say I have mail every time I open it?

I am using OSX 10.9.5 Whenever I open a terminal, it says something like: Last login: Wed Jan 21 10:29:13 on ttys002 You have mail. What mail is it talking about ? If I open the mail app, I have ...
1
vote
4answers
43 views

Two operations with sed on the same pattern

I use this following sed command for display names of files with a specific form: ls -1 *|sed 's/^\(.*\).png/\1\/\1,/g' If I have two files named BOH_Contour.png and BOV_Web.png, I obtain ...
0
votes
3answers
67 views

Count new lines in file last 1 minute

With bash, how to count new lines appended to file the last 1 minute? What would be smartest if you want to count new lines for the last 1 minute in multiple files simultanously and get output? I ...
4
votes
3answers
898 views

How to represent date format in '2015120' in Linux shell?

My colleague is generating log files with a preceding date format like 2015120, which represent January as 1 instead of 01. The usual way I'm using to deal with this kind of issue is using date ...
0
votes
2answers
75 views

Is there on Ubuntu a best way to execute a program than terminal command “./”

Is there on Ubuntu an best way to execute an program than terminal command "./". I have put PhpStorm into an folder and when I want execute PhpStorm, I must cd bin/ and execute with this command: ...
0
votes
0answers
33 views

How to mount Thunar's SMB mountpoint using command line

I have a mountpoint that defined by Thunar, as follows: /var/run/user/1000/gvfs/smb-share\:server\=10.7.7.254\,share\=myshare1/ How to mount that connection to that specified location without ...
1
vote
2answers
78 views

How do I get command name of the last executed command?

Example: I type man ls, than I want to get man only. By using !! I can get man ls but how do I get man?
0
votes
1answer
55 views

make custom commands on android 4.4.2

I want to program and debug in my android phone. To do that I downloaded c4droid and it's gcc plugin. after a lot of tries I understood that gcc is in directory ...
0
votes
1answer
44 views

timeout pipeline

I want to execute these two timeout command on the same command but with a different time and instructions. So timeout --signal=SIGINT 5s command timeout --signal=SIGKILL 10s command How to append ...
3
votes
2answers
120 views

Assign specific line from a variable to another variable

I would like to take a specific line from a variable to another variable. I tried this but it doesn't work: c="1.apple 2.banna 3.peach" read "Please choose fruit [1-3]:" t a=$c | awk "NR==$t" echo ...
-4
votes
1answer
113 views

Merge two csvfiles by column header

I have two csv files: success.csv "ID","Legacy ID","Field1", "Field2" 1,1111,google,news 2,2222,yahoo,news error.csv "Legacy ID","Field1","Field2","Message" 3333,aol,news,"Failed to upload ...
1
vote
1answer
67 views

Command prompt (PS1) including the number of files in directory (both hidden and regular entries)

I have finally come up with a favourite PS1 format but I find it takes too long to load. I need help optimizing... The part that is slowing it down is when I call the external commands in the prompt. ...
1
vote
3answers
51 views

How to express all files/directories at the extra -exec option of `find` command?

I have a task to copy all files from multiple directories with special names to a target directory. So I build this directory to test my command. The test directory tree looks like: . ├── dir1 │   ...
0
votes
1answer
46 views

Is there a way to see which user is logged into the system and has switched with “su”?

There are many person that may have access to the system and use a common user with more grants. How can I see which user is running a command? is there a way to use "ps" for that?
1
vote
2answers
50 views

Change icon for an application form command line?

Is there a way to change the icon of an application's window from the command line? For instance, I'd like to have separate icons for Firefox windows under different profiles (different processes), ...
0
votes
1answer
99 views

Using the cURL command, how does one fetch stock data which comes back *without* commas and spaces?

What can I add to the below script so that it fetches the stock data and brings it back WITHOUT any commas and spaces? For example GOOG Outstanding shares is 675,000,000. I desire the output of ...
1
vote
1answer
60 views

Using cURL command-line tool on Mac, how does one fetch stock data which comes back *without* commas? [duplicate]

The below script is not working. cd desktop/quoteUpdate while true do curl-o quotes.txt -s "http://download.finance.yahoo.com/d/quotes.csv?s=goog,aapl&f=sl1" sed -i '.bak' 's/,/ /g' quotes.txt ...
1
vote
2answers
49 views

`nl` invocation soaking all input before numbering

How can this be done? I don't see any applicable option in the manual. I have positively checked that indentation breaks after ten million lines. You can check it like: $ (for i in `seq 0 ...
1
vote
0answers
26 views

If I cancel when prompted for my Git password, I can no longer see anything I type, until I log back in [duplicate]

Everything still works (typing "exit", for instance, exits), but I can't see anything I type. There's not "funny characters", just nothing. Even re-running git and entering the password properly ...
3
votes
5answers
276 views

Awk - output the second line of a number of .dat files to one file

I have searched through previously asked questions and can't find an answer to what I am trying to do. note, I am new to linux. I have multiple files something like: (in reality i have 80) file1.dat ...
3
votes
3answers
174 views

Strip off word pattern at the end of string using sed

I have following string: ksh -x SCRIPT2.ksh $BUSSINESSDATE & PID=$!; ksh -x SCRIPT1.ksh $BUSSINESSDATE & PID=$!; I want to strip off the last word & PID=$!;. Desired result is: ksh -x ...
1
vote
6answers
75 views

using tee to output intermediate results to stdout instead of files

I know that to capture a pipeline's contents at an intermediate stage of processing, we use tee as ls /bin /usr/bin | sort | uniq | tee abc.txt | grep out , but what if i don't want to redirect the ...
0
votes
1answer
54 views

Searching a word from a specific dictionary file in sdcv(console version of Stardict offline dictionary)

I have recently installed sdcv(console version of Stardict offline dictionary) and have installed 5-6 dictionary files as shown here Whenever i search any word, using sdcv hello or sdcv cat , it ...
2
votes
2answers
88 views

Extracting values from a file keyed by multiple keys

Consider a file with key=value pairs, and each key is optionally a concatenation of multiple keys. In other words, many keys can map to one value. The reason behind this is that each key is a ...
13
votes
6answers
1k views

Is there another simple way to append line to end of file other than `>>`?

Recently I'm echoing short sentences to a tree_hole file. I was using echo 'something' >> tree_hole to do this job. But I was always worried of what if I mis-input of > instead of >>, ...
3
votes
4answers
108 views

How can I run a specific line as a command in a text file?

Sometimes I need to exec a single command which is in a shell script. I already know sed -n 'line_num p' can print that line. But how can I exec that printed out specific line as a command?
4
votes
2answers
387 views

Eject / safely remove vs umount

I'm using Ubuntu 12.04, and when I rigth click on a my flash drive icon (in the Unity right bar) I get two options that have me confused: eject and safely remove. The closer I came to answer was this ...
2
votes
4answers
102 views

Fastest way to read last line within pattern of multiple files with the same extension

I have in a directory /home/files/ some files that all have the same extension .txt. For example 1.txt 2.txt 3.txt 4.txt 5.txt test.txt These files are all the same in data format but the data are ...
3
votes
1answer
76 views

bash runs out of memory

This question is a fork of this SO question. Here is the MCVE version: $ PS1='Parent-$ ' Parent-$ type seq seq is /usr/bin/seq Parent-$ bash $ PS1='Child-$ ' Child-$ for i in $(seq 1000000000); do ...
1
vote
1answer
61 views

Is there any command in linux which will force linux machine to not shut-down

I have a very important process which is having a Queue, In Queue i'm storing important data and when if someone trap that process it must have to process the data which is there in the Queue after ...
3
votes
1answer
61 views

What's the shortest way to find my WAN IP address at the command line? [duplicate]

What's the shortest command I could use to find out my WAN IP?
1
vote
1answer
32 views

How do I keep running a command in the same area of the console window? (“w”)

I'm looking at the output of w: ehryk@ArchHP ~> sudo w 14:12:37 up 4:08, 4 users, ...
2
votes
0answers
46 views

How to access KVM guest console without password?

How can I configure a KVM guest running CentOS to allow passwordless console access from the hypervisor? I want to be able to use the following command to log straight in to the VM from the hypervisor ...
1
vote
1answer
52 views

Can I check how much energy a USB device is consuming?

Is there any utility I could use to check how much energy a USB device is consuming, for a given time frame?
1
vote
1answer
49 views

Output Redirection

I am using the tee command to output the compilation errors of a program into a file along with the terminal. gcc hello.c | tee file.txt This is the command I have used. The compilation errors are ...
12
votes
2answers
789 views

Ctrl+D for ending terminal line input

If I do $cat > file.txt text<Ctrl+D><Ctrl+D> Question1: If I don't press enter, why do I have to press Ctrl+D twice? If I do $cat > file.txt pa bam pshhh<Ctrl+Z> [2]+ ...
1
vote
1answer
76 views

What does this `xhost …` command do?

Please help me understand this line of command: xhost +SI:localuser:lightdm in reference to the answer in this post and also suggest if there's a better way and why that's needed. I couldn't make ...
3
votes
3answers
84 views

extract from line to line and then save to separate file

I tried my luck with grep and sed but somehow I don't manage to get it right. I have a log file which is about 8 GB in size. I need to analyze a 15 minute time period of suspicious activity. I ...
2
votes
1answer
76 views

How to install / parse build dependencies from debian/control?

Let's suppose you downloaded a source code folder, that contains an existing /debian/ folder as well as /debian/control file. Let's suppose the package in question is not in Debian official ...
1
vote
1answer
59 views

Get file names in awk result

I have many files in a location where I need to list file names in which 32th column has value more than 3000. This is the command that gives me those records: awk -F, '$32 > 3000' * Now can ...
1
vote
1answer
99 views

How can I add applications to the lxpanel application launch bar via cli?

Is there a way on LXDE toolbar to change what applications are on the quick launch part via the terminal so that it can be put in a batch file to change on multiple clients?
1
vote
1answer
29 views

How do I merge (without copying) two directories? [duplicate]

I have: $ find 1 2 -printf '%i %p\n' 40011805 1 40011450 1/t 40011923 1/a 40014006 1/a/e 40011217 1/a/q 40011806 2 40011458 2/y 40011924 2/a 40013989 2/a/e 40013945 2/a/w I want: <inode> ...
-2
votes
2answers
62 views

Can I copy multiple directories into a single directory with a single command?

I have used photorec to recover data from a HDD and now have many directories /home/ray/recup_dir.1, to /home/ray/recup-dir.598 taking up valuable space in my Home directory. I want to copy them ...
1
vote
1answer
36 views

Can't boot Voyager Linux based on Xubuntu

I recently installed Voyager Linux, an linux distribution based on Xubuntu. The problem is that I cant boot it anymore. I have a dual boot system with Windows 8.1, but that's not the problem. I ...