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

learn more… | top users | synonyms (1)

0
votes
2answers
24 views

how to delete files from a specific date and extension

Short and sweet: One of my hosting subscriptions got hacked. I ran this command: find path-to-folder/ -mtime -7 -name "*.php" –print this produced about 11 pages worth of malicious code which was ...
0
votes
2answers
58 views

Remove all files recursively without deleting directories

I want to "clean out" all of the files a directory including all files in subdirectories but I want to leave the subdirectories in place. My understanding of rm -r is that it will also delete the ...
1
vote
1answer
23 views

Zip the contents of a folder without including the folder itself

I have a directory called folder that looks like this: folder -> root_folder -> some files I want to zip this directory into zipped_dir, I tried: zip -r ...
1
vote
1answer
37 views

ss is replacing netstat, how can I get it to list ports similarly to what I am used to?

I've been trying to modernise my way with Linux by, for one thing, ditching netstat for ss. I looked up my favourite command line flag for netstat in the ss man pages, and was very glad to find that ...
1
vote
2answers
37 views

List the files of another format while finding a certain name pattern

I had wanted to edit the txt files of videoA and videoB only if the movs files names contains the namespace -test For eg. videoDir |-videoA |- videoA_v001_test.mov |- ...
0
votes
1answer
22 views

How to install oddjob-mkhomedir repository on AMI box using command line

I'm trying to install oddjob-mkhomedir and it comes back with no package available nothing to do. I used sudo yum install oddjob-mkhomedir so I'm assuming the repository is not available. My ...
1
vote
1answer
36 views

split line based on space and delete the second part

I have a big file >fid|29290408|locus|VBIEntCas2262_0001| Phosphoglycolate phosphatase (EC 3.1.3.18) [Enterococcus casseliflavus EC20] ...
1
vote
1answer
25 views

Broken git autocompletion after I have overridden the git command

Recently git branch <tab> started showing me the following error: $ git branch bash: -c: line 0: syntax error near unexpected token `(' bash: -c: line 0: `/usr/bin/git --git-dir=.git ...
1
vote
3answers
46 views

Display distinct values of a list and number of occurences

I have a program that writes on the standard output a list of string values, one per line, and I would like to display in real time the list of distinct values along with the number of occurences for ...
1
vote
1answer
25 views

How to zip only files under multiple subdirectories?

I have a folder working and its structure is something like this - working/ 100/ 1/ 2/ 3/ 200/ 1/ 2/ 3/ 300/ 1/ 2/ 3/ And each of these 1 ...
0
votes
1answer
14 views

Insert space at specified position in a file

I have this sample file: 234234|111||J1X0H8|SERP||R|D|666|M 234235|222||J1X0N5|SERP||C||555|M For each line, I need to insert a space after the 3rd character of the 4th column, like so: ...
1
vote
3answers
48 views

Removing mulitple lines

I am trying to write up a command line interfaces that will removes a particular section / lines of codes within a list of json files. By the way, the json file are located within the sub-folders of ...
1
vote
1answer
30 views

Save and restore terminal tabs with custom tabs title

I have a Terminal window with a dozen named tabs open *(gnome-terminal) I would like to save the current configuration and have it restored with names and directories. Is there a way to do this? I've ...
1
vote
1answer
37 views

How to run a command in background always?

the below command when I run from the terminal will keep posting the output to message.log cf logs broker-analytics > /var/www/cfbrokerlogs/message.log However, if i close my terminal it will ...
2
votes
2answers
57 views

Using the output of `grep` as variable in second command

I currently have 2 bash command line strings I use to gather data needed for a certain task. I was trying to simplify and have only one command used to gather the data without using a script. First I ...
1
vote
2answers
51 views

ls .. doesn't work properly with symlinks

I have directories set up a bit like this ~/code ~/code/src ~/code/build -> /path/to/somewhere/else That last one's a symlink. If I do this cd ~/code/build ls .. then I get the listing for ...
1
vote
3answers
210 views

How to copy files from the folder without the folder itself

I'm trying to copy files and subfolders from A folder without the A itself. For instance, A folder contains next: | file1.txt | file2.txt | subfolder1 Executing next command gives me ...
8
votes
2answers
425 views

Run another command before running the command the user wants to run

Let's say I want to modify the original behavior of the ls tool this way: $ ls Hello World file1 file2 ... How can I do this? When running ls I would like to run another command let's say echo ...
1
vote
2answers
178 views

Why does “grep '.*[s]' file” work and “grep .*[s] file” doesn't?

Comparing grep '.*[s]' file with grep .*[s] file Why do you need quotation marks to let this work properly? In the second case, grep seems trying to inspect every file with a period.
0
votes
3answers
34 views

Unable to use make to install Valgrind

I am attempting to download and install Valgrind using the following instructions: I get through step 3 just fine, but when I type make I get the message make: *** No targets specified and ...
1
vote
0answers
8 views

obexftp return code 97

I have been trying to send a file with bluetooth from my raspberry to my phone. I tried to use obexftp to do this but it gave me the return code 97. I have not been able to find out what this code ...
0
votes
1answer
29 views

Sourcing a redistributable script by default

I am creating a bash script which I wish to release on github. The script needs to access the command history but this is not possible without sourcing that script. I don't want users to put it in ...
1
vote
2answers
46 views

BASH: Command not running, special character '�' suddenly appeared (Ubuntu)

When I erroneously type 'ñ' (expecting to type any command) and then remove it and type the correct letter, the output returns the command with a special character attached �, obviously the shell ...
1
vote
1answer
27 views

Cannot remember the name of a CLI recorder software

I stumbled across a useful command line recorder that allows the user to copy the text when watching the 'recording'. I just cannot remember the name of the project. I just remember you can play and ...
3
votes
2answers
40 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
54 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
53 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
201 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
34 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
47 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
34 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
42 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
47 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
870 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
52 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
14 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
75 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
38 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
38 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
108 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
64 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
49 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
37 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
34 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
77 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
53 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
46 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
236 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 ...