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

learn more… | top users | synonyms (1)

0
votes
2answers
27 views

How to split a 6 or 7 GB file into several sub-2 GB files without splitting entry?

My level has 6 to 10 GB sized files as input. These files contain several lines of data. The next level's max input capacity is 2GB. So I have to split these 6-10 GB files into several sub-2 GB files ...
1
vote
3answers
48 views

How to combine two command outputs line by line? [duplicate]

let's say I have these two commands: $ cat file1 file1_a file1_b file1_c file1_d And: $ cat file2 file2_a file2_b file2_c file2_d How can I combine these outputs using a custom separator (e.g. .....
1
vote
1answer
25 views

bash kill process by call

I am using bash to start several instances of one python program, like this: python example.py -id $i where $i is the id given to the instance. All the processes are started on the same user, and ...
1
vote
1answer
35 views

cat into stdin then pipe into program keeps forked shell open, why?

I'm not sure what's going on but I've been trying to understand what is happening with the input and output. So here is my program. #include <stdio.h> #include <stdlib.h> int main(){ ...
0
votes
2answers
56 views

How to execute a shell script from anywhere on my server?

So basically I have a JS app that is inside a directory in /var/lib/app/. To start this node app I execute a start script startapp.sh from inside the directory. Now I need it to start at boot time, ...
0
votes
0answers
7 views

when installing KODI, I get this error

Errors were encountered while processing: /var/cache/apt/archives/kodi_2%3a17.0~git20160721.0200-e1f73d5-0xenial_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) i think its because ...
0
votes
0answers
8 views

How to use the man command to view documentation [duplicate]

I don't find man command to be much useful because I can't figure out what the flags are for and how all of them come together.
0
votes
0answers
16 views

Change location of executable [duplicate]

I wanted to install x264 cli encoder on OS X. I copied the downloaded binary to /usr/bin/, changed permissions and voila - it worked. Then I decided to be a smartass. So I deleted the file and ...
0
votes
1answer
33 views

Network slowness [closed]

I am facing an issue in my project.We support an App which is hosted on a unix server. Partners try to access the same from many regions. Now some users in an region say "R" are complaining about ...
3
votes
2answers
43 views

Protect session log from being written again by anyone

We have implemented a workaround to save command history in a new file for each user session for audit purpose. So each session file is identified by the start time and the username. The problem: The ...
0
votes
1answer
45 views

sed works on commandline but not in script [closed]

Why does this work when I type it direct on the commandline: oldversion=12345 newversion=67890 sed -i "s/${oldversion}/${newversion}/g" "/home/user/MyDir_${newversion}/MyDir_${newversion}.reg" But ...
0
votes
1answer
63 views

mv not working in script, but works fine on the commandline [on hold]

I am trying to put together a simple script that renames a few files and directories. If I type the entries directly on the commandline they work fine. But as soon as I put them in a script it doesnt ...
1
vote
2answers
45 views

Execute multiple ssh commands with different switch

I have a bash script for copying two files from a remote machine (that I cannot control), stored in a a path that needs root access. Here it is: ssh administrator@host "mkdir ${DIR}" ssh -t ...
0
votes
1answer
43 views

Undo last command possible? [duplicate]

In windows you can undo an operation if you press CTRL+Z. E.g. you delete a file in the gui then press CTRL+Z and the file will be restored and appears in the folder again. Is there something similar ...
1
vote
1answer
51 views

Find files in a directory for two days i.e today's and Yesterday

I need a command or shell script to find files within a folder for today and yesterday in Linux. Example If I run the command today it should give me the list of files created today and also ...
1
vote
2answers
39 views

inaccessible directory

I git cloned into a directory "/source" before I mkdired it. It did not show up in its parent directory, but when I run the ls command, the output is indented like this: database static ...
1
vote
1answer
36 views

Something like $CDPATH that works for all bash commands

I'm trying to figure out if there's a way I can get $CDPATH working for every command-line tool. At the moment, I have a directory in my homedir that's called src/ which contains all of my projects. ...
0
votes
1answer
24 views

Copy folders has specific part of name and it is content

I have a long list of folder as follow: 001_bat_3513 002_mon_3213 003_bat_3515 004_btt_3540 005_bat_4513 055_bpt_8523 056_bot_3513 058_bat_1513 . . From this list: How can I copy the folders ( and ...
3
votes
5answers
356 views

When I redirect the output of ls to a file, the filename is included in that file. How can I avoid this?

Observe: $ ls $ ls > list $ cat list list This appears to indicate that when ls is executed that the redirection into file list has already begun and the list file is already created. A fine ...
0
votes
1answer
56 views

ctrl-c unsets echo on terminal [closed]

On different Linux distributions I experienced that pressing ctrl-c to stop a program (like 'cmp') or completion causes the terminal (usually xterm or gnome-terminal) to not echo the input any more. ...
1
vote
2answers
50 views

Replace particular character but not if it is inside ()

I'm looking for a one-line command to make a file more readable. I want to replace all ; characters with newline unless it is inside a set of (). This is on a firewall, so I can only use bash; no ...
-1
votes
2answers
52 views

How can I see the number of visitors in my website via CLI

How can I find out the number of visitors in real time in my website? I'd like to access to it via SSH, so it should be some CLI programs. In the worst case scenario I was thinking to analyse the ...
3
votes
1answer
26 views

Override an existing folder with cp

Is it possible to override an existing folder with cp? Example: tux@linux:~ $ cd /tmp/test/ tux@linux:/tmp/test $ mkdir A tux@linux:/tmp/test $ cd A tux@linux:/tmp/test/A $ touch 1 2 3 4 tux@linux:/...
1
vote
1answer
35 views

remove lines that contain IP range from specific column while making exclusions to range

I have a logfile with the following format: Jul 13 21:47:41 192.168.100.254 "user from 192.168.100.101" I need to remove ALL lines that contain IP's in the 192.168.x.x range but only if they appear ...
0
votes
2answers
46 views

Command “paste - - - - ”, how to specify a big column number

In command paste - - - -, numbers of - is equal the future column number. In my case, I have 55,000 future column, for me wont need to put 55,000 - what I will can use? Example: title1:A1 title2:A2 ...
1
vote
3answers
37 views

Create link between two existing files

For example: I have file a.txt and file b.txt. I want a link from a.txt to b.txt. If I open/read file a.txt, file b.txt should open/read. If I try something like ln -s a.txt b.txt I get an error ...
1
vote
1answer
37 views

copy a file to a destination with different names

I want to copy a text file to a directory with multiple names with curly braces: cp /path/to/file/a.txt /path/to/file/{b,c,d}.txt But it gives me the error: target '/path/to/directory/d.txt' is not ...
1
vote
0answers
10 views

Setting locale in a systemd-nspawn container (debian jessie)

Trying to get powerline/airline symbols to show in vim running in a Debian container created with sudo systemd-nspawn -D ~/debian-tree/ on a Fedora host. Right now it just shows question marks in ...
1
vote
0answers
45 views

Install torrent CLI on montaVista 6

I have been trying to figure this out for a while now but I have never made any progress with it. How can I install a torrent client on my NAS (Seagate Central) box which runs MontaVista 6. I have ...
2
votes
1answer
47 views

What command(s) can I use in a terminal to find a program that does a particular thing? [duplicate]

I often find myself alt-tabbing to google "How to do X in Linux". Is there a way to search (say, man pages) in Linux to find tools that might be of use in a particular situation? For example, ...
1
vote
1answer
53 views

Capture all output, error, warning and their appearance order of linux's command

In linux we can redirect stdout and stderr or both of them to files. For example: Redirect stdout and stderr to two files: command 1>out 2>err. By this way, we can separate output and error in ...
0
votes
1answer
27 views

Ping through a specific Ethernet port

I am using RHEL 6.4, I have teamed two Ethernet ports (eth2 and eth3). I am trying to test the connectivity, I mean I want to test whether the eth2 and eth3 are working or not? One way is to disable ...
1
vote
1answer
48 views

basic webscraping from the CLI

I'm trying to fetch html tags and their attributes from a webpage with linux command line tools. Here's the concrete case: Here's the task: Get all 'src' attributes of all 'script' tags of the ...
4
votes
5answers
72 views

terminal command | grep IP

ifconfig -a | grep 10.16 inet 10.16.x.xx netmask 0xffffff00 broadcast 10.16.x.xxx inet 10.16.x.xx netmask 0xffffff80 broadcast 10.16.x.xxx I have replaced the numbers with x My aim is to ...
0
votes
1answer
31 views

What does | symbol near end of a command do? [duplicate]

I came across someone using the command zcat [filename].gz | less to open a file. What does | generally do when it's using in this manner? I've tried googling the question but haven't found the answer ...
6
votes
1answer
110 views

How do I get vendor-given name of my video card?

lspci gives me the following information: $ lspci|grep VGA 01:00.0 VGA compatible controller: NVIDIA Corporation GF104 [GeForce GTX 460] (rev a1) This is all correct, but this is generic name of ...
4
votes
3answers
230 views

Difference in cat sth vs cat < sth [duplicate]

I am new in linux.I have been playing with bash commands and realized that cat sth and cat < sth both happen to give same output. Are they same? Can someone explain?
0
votes
1answer
29 views

Pemission denied when trying to create a directory [closed]

[SHARAD@localhost ~]$ cd /var/www/html [SHARAD@localhost html]$ mkdir sharad mkdir: cannot create directory ‘sharad’: Permission denied [SHARAD@localhost html]$
2
votes
1answer
43 views

Pausing terminal output

I have a command which outputs lots of data (say, strace with lots of syscalls, running for a few minutes). Is there any option (e.g. command wrapper or something similar) that would allow me to ...
1
vote
0answers
17 views

Rejoin words breaked by hyphen and double newline characters

I have converted some PDF files to text by Calibre. Sample text as below: The booming population, coupled with a development strategy pre- mised on high levels of investment, meant that an ...
1
vote
2answers
42 views

Use root privilege without password

I am on Debian 8 and I am searching for a command in debian to use root privilege without password. I am asking because I already saw it somewhere but can't find it anymore.
1
vote
1answer
34 views

backgrounded job keeps stopping

I am seeing some strange behavior on my RHEL6 bash prompt. I often like to execute command lines that look like ... $ ./myscript > junk 2>&1 ... then hit ^Z and then execute ... $ bg $ ...
1
vote
1answer
38 views

Appending a line to a [section] of a config file

I've noticed that some Linux configuration files (e.g. /etc/samba/smb.conf) expect you to enter the actual settings (key value pairs) in a particular "section" of the file such as [global]. I'm ...
4
votes
4answers
422 views

How to obtain grep exit status into a variable

I started learning Bash a couple of days ago. I'm trying to obtain an exit status of grep expression into a variable like this: check=grep -ci 'text' file.sh and the output that I got is No ...
-1
votes
2answers
65 views

ps command not working properly? [closed]

I am using a Debian Virtual Box with the Bash shell and I am trying to use the ps command with the -c switch to find an ID of a process by searching its name. This is what I write: ps -c processname ...
-1
votes
1answer
51 views

How to create a bootable partition with an ntfs file system that is compatible with a Windows 8.1 boot USB drive

I've been trying to use fdisk and gparted and I believe that I have a suitable partition on /dev/sdb1. Here is my command list: fdisk /dev/sdb1 n (I filled the whole drive with a new ...
0
votes
1answer
62 views

How could I know my server's operating system? [duplicate]

I’m connected to my shared hosting server via ssh, and all I know is that it’s under Linux. I tried commands like: cat /etc/issue/ and lsb_release -a but got: $ cat /etc/issue/ No such file or ...
3
votes
1answer
213 views

How do I access a folder which I can't sudo cd into?

I'm trying to change my directory to /boot/efi, but running sudo cd /boot/efi does nothing. I'm on fedora 23. Is there a more powerful command for this?
0
votes
1answer
31 views

change IP address

I tried to change my private IP address with the following commands: sudo ifconfig wlp3s0 down sudo ifconfig wlp3s0 192.168.1.12 sudo ifconfig wlp3s0 up They just work fine becouse the IP changes ...
1
vote
3answers
64 views

awk to consolidate large tabular file?

I have a file with 21 tabular fields in columns. Tabs 14 and 15 are sets of data which are repeated several times for variables in tab 10(up to ":") and tab 11 has numeric descriptive data for tab 10 ....