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

learn more… | top users | synonyms (1)

0
votes
2answers
19 views

Why do du's subdirectory values not sum up to total?

I'm trying to use du to investigate disk usage in a directory like so: du -hd1 | sort -rh This gives me a list that starts as follows 61G . 7.9G ./A 5.1G ./B 2.7G ./.C 1.6G ./.D ...
0
votes
0answers
12 views

Check if there is no GUI

Is it possible to check if a UNIX machine (Mac / Linux) has a GUI? Basically I would like to distinguish between: UNIXes with GUI (i.e. normal Macs, Linuxs) UNIXes with no GUI (i.e. Mac server/ ...
0
votes
1answer
16 views

How to switch from input mode into command mode in ed ?

As far as I know, ed starts in command mode. Once I input i,a or c ed changes into input mode. So far it worked. Now I read that in order to switch from input mode into command mode one has to input ...
2
votes
1answer
25 views

How can I redirect output files to a specific directory/folder

Suppose I have an executable in Unix. Suppose the name of the .exe file is myExe and it takes two parameters. I did not create this executable, this is a freely available one. myExe generates 4 ...
0
votes
4answers
37 views

How does “-dc” work in “cat /dev/urandom | tr -dc ”01"?

So far I know, the /dev/urandom file is one of the special files, it's purpose is to generate random characters. When I execute cat /dev/urandom a stream of strange characters, some even Chinese ...
0
votes
2answers
47 views

Why would the prompt get overwritten?

p_ash-3.2$ cp some_file1234.html /some/loc/ation/ofthe/some_file1234.html.html_Backu Have been seeing this intermittent issue with the command-line, while typing longer lines as part of any command, ...
0
votes
2answers
46 views

use `mv` command and my file gone [on hold]

i want to move myfile.tar.gz to folder My command is mkdir backup mv myfile.tar.gz /backup arrrgh, and the file gone in /backup directory not exist, try using find command not shown how to ...
3
votes
0answers
25 views

Convention/standard on using curly braces around options

Man page for tar in arch linux SYNOPSIS section starts with: tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...] I perfectly understand that in this situation it means that exactly one of them ...
1
vote
1answer
45 views

cd to my folders shows me an error

I just logged out my system and logged on. And i tried to get into my folder cd /u/folder It says Too many levels of symbolic links. But it worked yesterday. What could be the reason? I found ...
0
votes
1answer
23 views

ssh-copy-id different port

i am trying execute ssh-copy-id in one port different than 22 (default). I researched and found the command below $ssh-copy-id -i ~/.ssh/id_rsa.pub "user@192.168.0.1 -p 22001" but, when execute the ...
10
votes
6answers
2k views

Is it possible to reverse a command in the bash shell?

I was wondering if there is a (simple) possibility to redo/reverse a command that was executed in the bash shell? (to make it undone) Is there something similar to the ctrl+z combination to redo any ...
3
votes
3answers
426 views

Why do we have to pass the file name twice in exec functions?

I read Advanced Programming in the UNIX Environment by Stevens, 8th chapter. I read and understand all the six of exec functions. One thing I notice is, in all the exec functions: first argument is ...
0
votes
1answer
18 views

Saving from arecord on a raspberry pi across a network to a mac

I've currently got a usb mic plugged into a Raspberry Pi B+ and am using the following code to record data: arecord --buffer-time=5000000 -D plughw:1,0 -f cd -t raw | lame -r - stream.mp3 I then ...
9
votes
4answers
434 views

How to remove duplicate characters?

If I am having a line as: Thhiisss iisss mmyyy nameeee I want to print this as: This is my name What is the unix command for this?
-1
votes
0answers
18 views

How can I check which partition scheme is used from the command line ? [duplicate]

I read, there exist two partition schemes: MSDOS Scheme and GPT (GUID partitioning table). I saw how it is made with Gparted, is it possible to show this information just from inside the shell ?
0
votes
1answer
24 views

Why aren't sda3 and sda4 displayed with fdsik -l?

I wanted to display all my partitions, so I entered "fdisk -l". AFAIK, the format of the device file for a scsi hard disk reads like: sd_whichharddisk_whichpartition. To my surprise, after hitting ...
1
vote
0answers
59 views

What is the meaning of the string **/* when used with grep?

I came across this picture (below), obviously it is a pun or some kind of allusion incorporating command-line expressions. Frankly speaking I do not understand anything of it except for grep -n. ...
1
vote
2answers
94 views

for loop when matching both front and back of file name

I'm trying to set up a for loop to run a process on pairs of files. The names of the files look like this 36_002_CGATGT_L001_R1_005.fastq.gz 36_002_CGATGT_L001_R2_005.fastq.gz ...
0
votes
1answer
36 views

What is the meaning of (^| )ABC( |$) as an extended REGEX ?

I came here across the command grep -E '(^| )ABC( |$)' file1 I am confused how to interpret the regular expression therein, because I know the ^ and $ character as beginning and end signifier, but in ...
1
vote
1answer
26 views

How do I control output after executing a command?

.. Script Run Complete. You have new mail in /var/spool/mail/<user-name> -bash-3.2$ I have seen the above message most the times on my prompt, probably while it's idle or as soon as script ...
1
vote
0answers
14 views

mkvmerge Backward Spliting not supported why?

I tried this:- mkvmerge -o new_file.ogg --split parts:0s-104s,+94s-208s,+8s-12s,+312s-410s,+17s-21s 500.ogg Thrown this error: "The start time must be bigger than or equal to the previous part's ...
1
vote
3answers
79 views

What is the meaning of ls -d ?

I entered the man page of ls, the entry for the -d option is as follows: -d, --directory list directory entries instead of contents, and do not derefer‐ ence ...
0
votes
1answer
24 views

tail-ing a filename that is a date [duplicate]

I am creating a logfile from kermit named the current date (which is in the format of DD MMM YYYY - which can not be changed AFAIK), and using the file name as today's date. I then have a Bash script ...
1
vote
1answer
31 views

Replace case-insensitive string in all folder files

I'm trying to replace a string with another in all files in dir. Trying to use this command sed 's/foo/bar/' * But it replaces foo and not fOo or Foo and others. how to find "foo" ...
0
votes
2answers
41 views

Why can't I kill the shell using the PID obtained from the $$ special variable? [duplicate]

After I have learned that the $$ special variable holds the process number of the shell, I tried too kill the shell by simply: kill , however this did not work, I also tried some variations, but them ...
-1
votes
0answers
26 views

Delete string from all the files in the folder

I'm seeking for way to delete string from all files in the folder by the regular expression pattern. Need to delete not the whole string but just pattern. Need to delete the strings which looks like: ...
7
votes
7answers
181 views

What is the purpose of having two variables ($@,$*) to transmit the arguments of a command into a script? [duplicate]

I have read of the special variables used in a script $@ and $*. As far as I understand, the arguments used while executing the script are stored into two special variables, once all arguments into $@ ...
1
vote
1answer
49 views

No such directory after creating it

I'm taking a basic Unix course and right now we're learning terminal. My directions are create a directory called company and subdirectories called sales, accounting and marketing. So I did that. ...
0
votes
1answer
34 views

SIPp “hello world” message to Asterisk

How do I run diagnostics against Asterisk? Asterisk is running on tleilax; and doge is on the same network (My network topology isn't optimal). Specifically, I want to do something like: sipp ...
1
vote
1answer
70 views

Changing themes and hot-corner settings from command-line

I want to change the elementary tweak themes and hot-corner settings on my Elementary Luna (built on Ubuntu 12.04 "Precise") from the commandline. With what command can I do this? I know how to make ...
-2
votes
0answers
30 views

Remove the string from the all the files in the folder

Need to remove the sought-for string from the all files in folder. Could you give me please the pattern of command? Big THX.
1
vote
1answer
111 views

Linux commands for kids [closed]

My youngest daughter (6) is fascinated with the sl and gti commands. She even learned to combine them with ; and when the time comes to teach her about return values I'll show her how sl && ...
1
vote
1answer
15 views

How to display metainformation for different kinds of time of a file ?

As far as I know each name within a path, e.g. /name1/name2/name3, is allocated to one inode. This inode is a collection of meta information for each name (file or directory). Some of these ...
-1
votes
1answer
41 views

How to install stardict from a tar.gz manually ?

I have downloaded stardict-2.0.0-pre2.tar.gz and applied the extraction on it by writing: tar xzvf stardict-2.0.0-pre2.tar.gz , thereupon a new folder was created with the following content: From ...
1
vote
2answers
67 views

How to list only JPEG files from root below using the command line ?

I am searching for a method to find only JPEG files, With my limited knowledge of Linux I came to this point: 1. list all paths that exist from root below with find / 2. pipe the result into next ...
11
votes
5answers
790 views

How do I get the size of a directory on the command line?

I tried to obtain the size of a folder (containing folders and sub folders) by using the ls command with option l. It seems to work for files (ls -l file name), but if I try to get the size of a ...
3
votes
3answers
65 views

how to remove accidentally created '~' and '..'

I'm using wget to download some webpages and I used the -P option without knowing that it wouldn't expend .. or ~. So I found I've created them after running the program. Now the problem is, how do I ...
2
votes
0answers
31 views

How to display entire subject line in `mail`?

There are two messages in /var/mail/test. mail Mail version 8.1.2 01/15/2001. Type ? for help. "/var/mail/test": 2 messages 2 new >N 1 test@test Tue Feb 17 15:07 18/628 *** SECURITY ...
-1
votes
2answers
21 views

How to create a new partitioning table on SD card from the command line ? [closed]

I have tried to mount a SD card on Linux Mint, I have found the right device file and tried: mount -t vfat /dev/sdb /mnt/zauberportal ,but it failed and I tried some variations like different types of ...
2
votes
2answers
77 views

Using find to list all files under certain directory

I'm trying to use a single line command that will find every directory (or sub-directory) named bin and will then print a list of all the files under it, but will not also list the directory names ...
0
votes
3answers
70 views

Simple TCP server listening on a port but not returning SYN-ACK

I am looking for a command-line TCP server (preferably a one-liner), that will listen on a specified port and when received SYN, it will not respond with SYN-ACK as usual TCP servers do. The purpose ...
0
votes
2answers
24 views

Simple http server from the command line that will always cause a timeout

Regarding the question Simple command line http server I would like to know, what is the simplest method for creating a http server listening on a specified port that will always cause timeout (it ...
0
votes
1answer
40 views

How to find with grep lines that end in a certain string?

I know that to find a REGEX that ends in a certain string I have to write "string$". Although I tried the following variations of grep : cat foo | grep "string$", cat foo | egrep "string$", grep -E ...
1
vote
2answers
56 views

Copy files to multiple computers over LAN

Good day, I am pretty new to Unix and I need to do this simple task. I have a few files, let's name them file01, file02, file03 etc. and I need to copy each of them to one computer from a list. The ...
0
votes
1answer
39 views

What does the option -C achieve in ls output?

In the man pages it says: -C list entries by columns However, I really cannot notice any difference between the output of ls or ls -C, could someone explain this to me?
1
vote
0answers
30 views

How much arguments can I pass to command? [duplicate]

Is there any limit of arguments that could be passed to C/C++, Python, Bash etc. program? Practical usage: pass bitmap data from/to C++ to/from Python program via arguments.
0
votes
2answers
57 views

What regular expression in grep searches for strings of three same letters in a row?

I have a text file and I am using the grep command with a regular expression to get only the lines which contain three same successive letters, e.g.: aaa bbb ccc ddd What regular expression do I ...
11
votes
4answers
535 views

What is the meaning of IFS=$'\n' in bash scripting ?

at the beginning of a shell script program in the bash is the following line: IFS=$'\n' What is the meaning behind this collection of symbols ?
-1
votes
2answers
47 views

How do I get a list of all directories and files with absolute paths each line ?

Using ls -R / i get every file and directory listed that exists, but not in the desired format. What do I need to write on the command line in order to get a list in such a format, that every line ...
5
votes
3answers
285 views

How do I move all the files with the same name scattered through the file system into one folder?

I have a file system tree and on different locations within it are files with the same name. I tried the following command on the command line: find / -name "HAHA" -exec mv {} /home \; It only ...