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

learn more… | top users | synonyms (1)

0
votes
0answers
6 views

sources.list Debian 8 doesn't work!

recently I've installed Debian 8 Jessie, so I wanted to install some packages but I got the message that I need to insert the System Installation CD in order to proceed with package installation. I'...
2
votes
2answers
39 views

What are these memory strings? What do they do? [duplicate]

Recently, I dumped my memory strings (just because I could) using sudo cat /dev/mem | strings. Upon reviewing this dump, I noticed some very interesting things: .symtab .strtab .shstrtab .note.gnu....
0
votes
2answers
30 views

Generating strings of words with space delimiters from cut statement

I am new to bash. When I run the following command: grep "type" /root/myFile | cut-d'=' -f2 I get the following: 102 304 503 442 I want to store the contents of the first command into a ...
3
votes
1answer
31 views

Can I get just the list of network interfaces from ip?

I am looking to retrieve a list of network interfaces. Currently I am returning the results of ip addr and then doing some regex/string searching from output like this: 1: lo: <LOOPBACK,UP,...
2
votes
3answers
31 views

Ignore specified absolute directories with tab completion?

I work on a cluster with many users. There are 50 users on the cluster with the same first letter as my username, and a user who has the same name up to the last letter. When I tab complete from /home/...
4
votes
1answer
202 views

How to know the utilization of intel CPU and GPU in Linux?

In ubuntu, to know the time taken by CPU to run a program we would use time in terminal. Whereas in case of intel GPU, we would use intel_gpu_time. But in case of CentOS time command works. But ...
0
votes
5answers
46 views

Return one value and save it into a variable

I have this sentence that returns two values. cat /ora$sid/dbs/listener.ora|grep PORT|sed 's/.*PORT.*\([0-9]\{4\}\)\(.*\)/\1/' Return 1521 1522 With this sentence I want to get only one value. ...
0
votes
1answer
29 views

Possible to reuse first argument of BASH line in the same line?

I do this in BASH echo test "$1" ..expecting to get.. test test ..but I get.. test Is this something possible to do? It would make my life easier since having a list files I could do ...
0
votes
2answers
30 views

BASH get value from string

I have this string stored in a variable <li class="rainbow-list-item southern disrupted " data-line-id="lul-southern" data-severity-codes="4,6,9" data-mode="national-rail"> and I would like ...
1
vote
1answer
19 views

Ask for password while mounting cifs share

I am looking for a way to make the mount command prompt for the password so my password doesn't show up in any system history, I thought I would have it run read -s -p command inside of the mount ...
-4
votes
1answer
37 views

How to fix whois Command Error

i have Kali Linux version 2016.1 installed on my system. i am trying to run command "whois " but there is an error "bash: whois: command not found"
0
votes
0answers
30 views

Delete files based on files name comparing to sysdate? [duplicate]

I've files with a prefix name like this: 20160623a.dat 20160623b.dat 20160623c.dat 20160623d.dat [20160623] is a prefix that generated with date "+%Y%m%d" command. I'd compare this prefix to ...
2
votes
3answers
136 views

How to search a text file for a specific integer

Is there a simple way to search a text file (source code) for all instances of a specific integer. This should not trigger on larger numbers that happen to include the integer as a sub-string, but it ...
0
votes
1answer
43 views

Rename file (Prefix) with full path?

I'd to Prefix my files (.dat) like this : CLY_BIZ_COM_PERD.dat -> 20160622CLY_BIZ_COM_PERD.dat I have tried the following: key=`date "+%Y%m%d"` for i in $(ls /Path/*.dat); do mv ${i} "${key}${i}...
3
votes
2answers
36 views

Is there a shortcut to rerun a command with arguments from last command (not cd, ls or echo)

Searching through passed Logfile with something like this: cat /path/to/logfile | grep -iEw 'some-ip-address-here|correspondig-mac-adress-here' This gives me all the passed log lines until now so ...
1
vote
2answers
55 views

Count the number of lines found by grep

I want to know how many instances of a pattern are found by grep while looking recursively through a directory structure. It seems I should be able to pipe the output of grep through something which ...
2
votes
1answer
29 views

SQLite3 command line: how do you cancel a command?

I made a mistake writing a command at the SQLite command prompt, which I now want to abort, this is how my command line looks sqlite> select * from todos' ...> ' ...> ;^C In this ...
0
votes
3answers
77 views

How to do a loop to execute many files

I have a script which function like this for one file. ./script 0001g.log > output for two or more files, like this ./script 0001g.log 0002g.log 0003g.log > output The script take one ...
6
votes
2answers
366 views

Remove all files with a prefix except the one of the largest size

What is the best way to remove all the files in the current directory with some prefix, except the file with this prefix but having the largest size among all the files with this prefix? (In the ...
0
votes
0answers
43 views

First 0 of a number is being trimmed [closed]

I use this line to get the (unique) value from a file and use it as an argument in a bash script like so: casperjs script.js --num=`cat num` The script works well. Except that when the number ...
1
vote
2answers
142 views

How to remove the same size files in a directory?

I have images, I need to delete some files with the same size. But no need to remove all such images, but only the next in the queue (in alphabetical order): 1.png # 23,5 Kb 2.png # 24,6 Kb 4....
0
votes
2answers
32 views

Uuencode is displaying the file contents in email body instead of attaching the file in the attachments

I want to send a simple text file as an attachment in an email. When the email is delivered, the attachment is missing, instead, the contents of the attachments are displayed in the email body. Need ...
6
votes
1answer
46 views

Display stdout and stderr in two separate streams

I'm looking for a way to visually separate stdout and stderr, so that they don't interleave and so that they can be easily identified. Ideally, stdout and stderr would have separate areas on the ...
3
votes
2answers
31 views

Forward results of Find command to javac

I wish to compile the results of a find command where the find command returns the relative filepath of a java file located in subdirectories. E.G., I am in ./ and I want to run javac on a file, ...
2
votes
1answer
50 views

Submit password with sudo and execute script with nohup

I would like to download and run a script in the background so the task is independent of the shell and its exit. Moreover this script should be run as sudo, using: echo MY_PWD | sudo -u MY_USER -S .....
-3
votes
0answers
37 views

I want something to be printed at the start and end of dmesgs [on hold]

echo " END COLLECTING DMESG_">/dev/kmsg is the command I used before running an IO and after running an IO. Once after clearing dmesg, sometimes I was unable to print the statement.
2
votes
3answers
465 views

Pass output of “whereis” command to “cd” to change directory in one step

It should be simple no-doubt, but I can't find a way to pass output of whereis command to cd command in same line so I don't have to do cd in the second step. I have tried passing like below: cd $(...
1
vote
1answer
23 views

Use SELinux to restrict a directory to a particular user

I have a couple of questions: (Sysadmins tasks) Here is what I asked to do Create user Tim and add him to the supplementary group Webdev (Create the group if it doesn't exist), also Set Tim's ...
1
vote
0answers
22 views

open several directories from the terminal as tabs inside a single file manager window

I want to open several directories from the terminal as tabs inside a single Nautilus window. If Nautilus cannot be used then I want to know what GUI based file explorer can open directories in ...
0
votes
4answers
55 views

Delete specific line numbers (passed as variable) from a file in linux

I have two files. One having list of lines (which I don't require) say Seqlist and other text file (from which I intend to delete those corresponding lines) say ContentFile $cat Seqlist 3 4 ...
0
votes
1answer
35 views

Curl to grab the page after complete load

I have a url which takes some time to load completely. But when I use curl to download the link as html, it download the html at the real time before loading page completely I mean complete execution ...
-1
votes
0answers
35 views

dd does not work for an image created in freebsd 9.3

I tried to dd the image created in freebsd 9.3 $ sudo dd if=test.img of=/dev/disk2 bs=1m Password: 0+0 records in 0+0 records out 0 bytes transferred in 0.000010 secs (0 bytes/sec) This works in ...
1
vote
2answers
57 views

How to zip directory with encryption for file names?

Using command line, I know that I can encrypt a directory with the following command: zip -er Directory.zip /path/to/directory However, this does not encrypt the filenames themselves. If someone ...
1
vote
2answers
44 views

How to move string from one line to another

I have been editing a large text file containing pairs of lines as follows (repeated): \> destination_file.txt js -e "var e='.jpg',t='b',i='14712583',h='0.us.is.example.com',s='/',n='WIV',u='...
0
votes
0answers
14 views

steps to troubleshoot bluetooth dongle?

How do I troubleshoot, or at least gather more data in order to troubleshoot, a bluetooth dongle? In particular, from the CLI. On a lower level, I can see the bluetooth hardware: thufir@mordor:~$ ...
0
votes
1answer
32 views

Cleanest way to require the user to enter password to run a program?

What is the cleanest way to require the user to enter password in order to run a particular program without the use of third-party applications? For example, if I type firefox to launch it from the ...
5
votes
1answer
59 views

Random image generator

I am generating random data and trying to convert it to a PNG image using : head -c 1MB < /dev/urandom | hexdump -e '16/1 "_x%02X"' | sed 's/_/\\/g; s/\\x //g; s/.*/ "&"/' | tr -d "\"" | ...
32
votes
2answers
1k views

Difference between “command not found” and “no such file or directory”?

For example: $ node -bash: /usr/local/bin/node: No such file or directory $ foo -bash: foo: command not found What's the difference? In both cases, node and foo are invalid commands, but it seems ...
0
votes
0answers
7 views

Why doesn't wpa_supplicant work when using crontab job?

I am writing a script that is installed via a crontab job. The point of the script is to locate a specific AP and connect to it on start up. The script will log its progress to a text file called, "...
1
vote
1answer
24 views

How do I select which remote vifm instance will run a command?

I run two separate instances of vifm on my machine: $ vifm --server-list documents photos In one I'm organising documents and in the other photos. Sometimes I'm inside a third shell and would like ...
0
votes
2answers
77 views

how to exclude string that include space by “grep -v” [closed]

I have a script that runs by using bash -c and I want to know how many process are running with that script. $ ps ax | grep my_script_run | grep -v grep | grep -v "bash -c" 11121 ? S 0:00 ...
-1
votes
3answers
42 views

Run su -s with arguments

I run to run a command using the su -s command to start a process. Since I do not want the root user to own the process. I try to do this by issuing the command su -s "$CATALINA_HOME/bin/catalina.sh ...
-2
votes
2answers
61 views

Find all line in a file which start with g or any digit from 0to9

How do I find all lines in a file which start with g or any digit from 0 to 9? Can any one help me using command line? I try and I know how to do if start with g but don't know how to do with g and 0 ...
1
vote
0answers
36 views

Converting .odm to .odt or .pdf - command line

I saw this question: Converting .odm to .odt, where someone shows to convert an .odm file into .odt or .pdf. Is there also a way to do this in a command line? I have an Open Document Master file, ...
0
votes
1answer
42 views

what is difference between l and ls commands [duplicate]

ls command shows the following : a code controller.js mani sparat this ubuntu.gif l command the shows similar to that : a/ code/ controller.js mani/ sparat/ this/ ubuntu.gif What is ...
2
votes
1answer
36 views

GNU screen tab gets renamed whenever I type a command

When I use gnu screen, in other tabs, I ssh into other machines, rename the tab accordingly, and do work normally. The tab name sticks. In a fresh tab, which is just a terminal on the original ...
1
vote
0answers
27 views

Find recursively files that have a percentage of lines in common

Is possible to do this? I want an output where i have only files that are 50% the same of others or have 20+ lines in commons. I'm trying to isolate commons functions in *.java files. Thank you!
0
votes
2answers
41 views

Is there a way to use this command without having to type 'y' all the time?

I am trying to remove all ruby gems before uninstalling ruby. The command I am using is: sudo gem uninstall --all to achieve this. However, I have to type y continually to remove things. Is ...
2
votes
3answers
53 views

How to delete a variable string in file

Actually I am using sed -e s/Perro-A//g -i *-a.log to delete the string Perro-A from many files ending with *-a.log. But sometimes in the files I might not have Perro-A; I might have strings ...
1
vote
3answers
151 views

Use regex to check if particular directory has folders starting with specific word

I am writing a script that checks a certain directory for any sub-directories starting with a specific word. Here is my script thus far: #!/bin/bash function checkDirectory() { themeDirectory="/...