Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
I was asked this question in one of the interviews.
Can anyone please explain
ls -1 will list files each on separate line...
whereas ls itself will list them like so
ls -l shows all files or directories, with their respectives names, sizes, last date and hour of modification, and also all permitions for them.
while ls -1 will list files each on separate line
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
Given the following sets:
Set 1:
abc_data_y1
abc_data_y2
abc_text_y1
abc_text_y2
Set 2:
xyz_data_y1
xyz_data_y2
xyz_text_y1
xyz_text_y2
Can I create all 8 files (in the 2 sets) with ONE command?
If not, can I use ONE command per set to create all 8 files?
Thank you in advance.
In shells that support brace expansion (e.g. bash), you can make it shorter by
touch {abc,xyz}_{data,text}_y{1,2}
If you only want to create blank files and then edit them you can create them in one command using touch from the command line.
touch abc_data_y1 abc_data_y2 abc_text_y1 abc_text_y2 xyz_data_y1 xyz_data_y2 xyz_text_y1 xyz_text_y2
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I was wondering how to delete the first 196 lines of multiple html documents with sed.
The directory structure I have goes as follows:
find /rootdir/ -name index.html -exec sed -i '1,196d' {} \;
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
i.e.
List any files between 2014-01-25 1300 - 2014-01-25 2000 in
Cheers
You can use the find command with multiple selectors - e.g. find . -mtime +1 -mtime -3. It can be used with ctime, atime, etc., as well.
Assuming you have a GNU find (which you could compile on SunOS if you don't have it), use the age range options for find
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How do I reduce the size of a file using tail?
I just need the last 1000 lines of the file. I need the trimmed file name to remain the same.
tail -1000 file.txt
To make a new file
tail -1000 file.txt > newfile.txt
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need a shell script that should remove the matched pattern .
Can anyone please help me ?
The command is
sed -i -e '/yourpattern/d' your_file