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

learn more… | top users | synonyms (1)

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@...
19
votes
7answers
95k views

How can I monitor all outgoing requests/connections from my machine?

My machine is a server so I want to ignore connections being made to my server (e.g. when someone visits my website). I want to see only connections/requests being made by my server to other places. ...
6
votes
4answers
6k views

How to convert to HTML code?

Are there any scripts that can convert between text (e.g. <hi>) and the html entities version (&lt;hi&gt;) like this website does? Or at least a PHP file?
18
votes
3answers
22k views

Is there a simple command for outputting tab-delimited columns?

E.g. I have a file (produced with echo -e "var1\tvar2\t\var3\tvar4" > foo) that are output as: $ cat foo case elems meshing nlsys uniform 2350 0.076662 2.78 non-conformal 348 ...
35
votes
2answers
43k views

How to signal the end of stdin input

In Bash, I learned that the ending signal can be changed by here document. But by default how can I signal the end of stdin input? I happened to find that with cat and chardet, their stdin inputs can ...
9
votes
5answers
51k views

Parse XML to get node value in bash script?

I would like to know how I can get the value of a node with the following paths: config/global/resources/default_setup/connection/host config/global/resources/default_setup/connection/username ...
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
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 ...
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 (...
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 ...
5
votes
1answer
3k views

How do I decrypt a message using openssl's CLI?

I have a message, I know the password and the cipher that was used to encrypt it, but I can't figure out how to ask openssl to decrypt it. I see the cipher in the output from the ciphers command, and ...
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
32 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 ...
3
votes
0answers
69 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 ...
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 ...
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 ...
7
votes
3answers
8k views

How to permanently enable scl CentOS 6.4?

I installed a newer version of devtoolset (1.1) and was wondering how I would go about permanently setting these to be default. Right now, when I ssh into my server running CentOS, I have to run this ...
-2
votes
2answers
9k views

How to delete a file in Arch console?

pacman stopped working and asked me to delete a file if "another package manager isn't working". What is the file for deleting files?
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 ...
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/...
-1
votes
0answers
55 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'...
0
votes
1answer
3k views

IBM V7000 scripts for monitoring

Hello (I'm no hard core coder:), I try to develop a script to do some very basic monitoring on an IBM SVC. My goal is to get some information about the nodes and my quroum status and then send ...
2
votes
2answers
46 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
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 ...
3
votes
2answers
313 views

How to change the color of all highlights in a PDF file?

I want to change the color of every highlight in a PDF file (without having it do for every highlight manually). Preferably with a command line command. Here is an example PDF with a highlighted line....
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
35 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,...
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. ...
4
votes
1answer
231 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 ...
17
votes
6answers
54k views

Delete 100 lines from vi editor using single command

I am using Ubuntu and trying to delete all 100 lines from vi editor but I got interview question of doing this in one command.
0
votes
2answers
35 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
92 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 ...
64
votes
6answers
194k views

How to stop a background process?

I have started a wget on remote machine in background using &. Suddenly it stops downloading. I want to stop its process, then start it again. How can I stop it? I haven't close its shell window. ...
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 ...
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}...
1
vote
2answers
441 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....
6
votes
2answers
400 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
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 ...
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 ...
43
votes
6answers
24k views

Split pages in pdf

I have a scanned pdf file which has scanned two pages on one virtual page (page in pdf file). The resolution is with good quality. The problem is I have to zoom when reading and drag from left to the ...
8
votes
2answers
47k views

How to fix curl sslv3 alert handshake failure?

I'm trying to curl HTTPS website in the following way: $ curl -v https://thepiratebay.se/ However it fails with the error: * About to connect() to thepiratebay.se port 443 (#0) * Trying 173.245....
0
votes
3answers
106 views

htop displays incorrectly on different vps

When I use "htop" command for linux (+F5), layout on 2 my vps different: Why on my first server I see broken tree?
32
votes
7answers
5k views

How do I create a blank PDF from the command line?

I recently needed a single blank PDF page (8.5" x 11" size) and realized that I didn't know how to make one from the command line. Issuing touch blank.pdf produces an empty PDF file. Is there a ...
67
votes
12answers
87k views

Efficiently delete large directory containing thousands of files

We have an issue with a folder becoming unwieldy with hundreds of thousands of tiny files. There are so many files that performing rm -rf returns an error and instead what we need to do is something ...
2
votes
0answers
200 views

How do I recursively apply default ACLs of a directory to its descendants?

If I have a directory with default ACL entries assigned to it, but some or all of its descendant files and sub-directories have access or default ACLs that do not agree with those defaults, how do I ...