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

learn more… | top users | synonyms (1)

3
votes
0answers
60 views

two piped commands, each needs to read password from stdin

Is there a way to sensibly do this: scp user@host:/path/to/file /dev/tty | openssl [options] | less without creating a file, and without having to supply either password directly in arguments? The ...
5
votes
2answers
265 views

no null in /dev error

I executed the following line: which lsb_release 2&>1 /dev/null Output: error: no null in /dev When I verified the error using the ls /dev/null command, null was present in /dev. Why is ...
-3
votes
1answer
49 views

What command lines should I use for the following? [closed]

What command lines should I use for... printing a list of users running bash now in alphabetical order print the count of users who are running bash right now save the list of users who are running ...
1
vote
0answers
11 views

Fluxbox, how to launch specific instance of application in a workspace (from cli)

This almost does what I want Fluxbox, how to launch some applications in a specific workspace at startup but not quite. I want to be able to save the position and workspace of a specific instance of ...
0
votes
1answer
28 views

How to filter files/directories according to permission and owner(tree command)

I use tree command to get files and directories under the /usr path, tree -pgufi /usr Does it have a way to filter files/directories under this path according to several conditions(1 and 2 and 3)...
3
votes
0answers
21 views

how do I make a SIP phone ring with sipsak?

How can I use sipsak to simulate a call so that there's an actual ring, or possibly even a sound is played? thufir@mordor:~$ thufir@mordor:~$ sudo sipsak -v --usrloc-mode --from sip:demo_alice@...
0
votes
3answers
25 views

Separating command arguments from flags

Say I have a command that takes flags and arguments, like this: mycommand --foo bar arg1 arg2 (The foo flag has a value of "bar".) But what if the foo flag can optionally be supplied with no ...
1
vote
0answers
23 views

How can sipsak simulate a call with usrloc?

Building on a stackoverflow question, how can I actually get the device to ring? thufir@mordor:~$ thufir@mordor:~$ sudo sipsak -vv -s sip:6003@localhost No SRV record: _sip._tcp.localhost No SRV ...
0
votes
0answers
23 views

Create user who can only ssh and reboot machine [duplicate]

I have a problem when I want to create user for SSH and rebooting the machine only. What I did is I just created a normal user. But normal user can access other commands like reboot, vim, ps, etc. I ...
0
votes
0answers
33 views

How can I use sipsak to send a SIP Invite to lrnlookup.telnyx.com with sipsak?

Here's what I have so far: thufir@mordor:~$ sipsak --from sip:thufir@getonsip.com --password flFl24GB5 --invite-mode lrnlookup.telnyx.com --message-mode error: for the USRLOC mode you have to give a ...
2
votes
2answers
32 views

Recursive comparison and deletion (without rsync or hashing)

I've been using rsync to synchronise folders and it works well. The problem is that more recently I've started syncing folders with larger files in them, and it takes much longer than I'd like it to (...
0
votes
2answers
96 views

How do I record all terminal input and output to a local file by default for each session?

I'm aware the script command can be used to record all keyboard input and screen output to a file, but this has to be invoked each time a terminal session is started. I keep timestamped versions of my ...
1
vote
2answers
24 views

How to inhibit dhcpd from outputting over the console login prompt?

As dhcpd negotiates it prints its output on the login prompt, which clutters (messes up, wrangles, uglifies, writes over, obscures [synonyms for googlers]) the console login prompt. How to inhibit ...
2
votes
1answer
53 views

How can I decompress and print the last few lines of a compressed text file?

I have 6 gzipped text files, each of which is ~17G when compressed. I need to see the last few lines (decompressed) of each file to check whether a particular problem is there. The obvious approach is ...
0
votes
4answers
68 views

How can I run a command periodically and indefinitely till it's turned off?

I want to run a command every several minutes until I turn it off. After some searching, I found lots of ways of doing the first half (running a command periodically and indefinitely), what about I ...
3
votes
0answers
70 views

How to do with “ndd” for get “ethtool” equivalent on Solaris

I've to restore a large file from a NAS backup on Solaris 10 ZFS. I'm using this following command: rsync -av user@xxx.xxx.xxx.xxx:from/NAS/files/system to/solaris/files/system And I've got this ...
1
vote
1answer
45 views

firefox -private sometimes opens a non-private window

This command will open firefox in the private browser mode correctly firefox -private & However this command is only opening firefox in regular browser mode. firefox -private& What is ...
0
votes
0answers
35 views

How to Rename files in subfolders with subfolder name? [duplicate]

The directory structure is as follows: PWD/ A1/ acc.bam A2/ acc.bam A3/ acc.bam A4/ acc.bam All the acc.bam files should be renamed with subfolders names. For eg: "acc.bam" ...
1
vote
0answers
33 views

How can I get a translated string from Google Translate with curl etc?

How can I get a translated string, e.g. English to Spanish, from Google Translate with some command line tools like curl? I looked at the page source but Google Translate doesn't seem to include the ...
-1
votes
0answers
56 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
47 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....
1
vote
2answers
32 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
36 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,...
3
votes
3answers
44 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
232 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
56 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. ...
1
vote
1answer
37 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
36 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
31 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
96 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
148 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
50 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
39 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
57 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
51 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
78 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
403 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 ...
1
vote
2answers
453 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
56 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 ...
7
votes
2answers
64 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
32 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
65 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 .....
2
votes
3answers
478 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
25 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
26 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 ...
-1
votes
1answer
77 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
vote
2answers
86 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
49 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='...