Search Results

Search: Posts Made By: Xubuntu56
825
Posted By Xubuntu56
EDIT: fixed it. Putting -maxdepth before -name...
EDIT: fixed it. Putting -maxdepth before -name works!

@rbattel

When I run find . -name "*d*" -print several hundred files are found, as it delved into subdirectories (not my intent)

but...
825
Posted By Xubuntu56
permissions fixed it! thanks! edit: it is...
permissions fixed it! thanks!


edit: it is not a folder; I was just experimenting
825
Posted By Xubuntu56
Command finds some, misses some
The contents of my home directory:


bin Desktop Documents Downloads folders Music Pictures Public Templates Videos

When I run the command for file in /home/myself/*d*; do if [ -x...
1,352
Posted By Xubuntu56
Orienting select choices vertically
From my script


#!/bin/bash
echo "Which of these does not belong in the group?"; \
select choice in Mercedes Audi Chevrolet Audi Porsche BMW Volkswagen; do
if [[ $choice = Chevrolet...
898
Posted By Xubuntu56
Output of until to file versus stdout
Why does this until false; do history | head -5; done
result in a stdout infinite loop, yet until false; do history | head -5 > hist5; done
only writes it once to file hist5? Furthermore, I can...
1,699
Posted By Xubuntu56
Renaming batch by removing substring
I wish to rename all files ending in .txt by removing .tex.

Currently I have

me@me-Inspiron-518:~$ ls
a.tex.txt bin b.tex.txt c.tex.txt Desktop Documents Downloads d.tex.txt ...
1,561
Posted By Xubuntu56
Isn't >&2 the same as 1>&2 , both of which say...
Isn't >&2 the same as 1>&2 , both of which say "Send <stdout> to where <stderr> is pointed towards (the terminal)?
Or, stated another way, "Send 1 to where 2 is going, which by default goes where 1...
1,613
Posted By Xubuntu56
Is there a "gray area" between grepping and...
Is there a "gray area" between grepping and globbing?
A moment ago I just read that "The moral of the story is that grep never uses globbing." (see link)
I also thought I had it straight in my mind...
1,613
Posted By Xubuntu56
@Scrutinizer--it does relate to the question, as...
@Scrutinizer--it does relate to the question, as it performs the task. It found the target file, partx, in /usr/bin.


I don't understand why, however, as the man page for ls says the -d option is...
1,613
Posted By Xubuntu56
@stomp--ls | grep "^p.*a.*x$" works great, with...
@stomp--ls | grep "^p.*a.*x$" works great, with either single or double quotes. I'm used to thinking of the asterisk as a wildcard, which was confusing me at first.
@bakunin--this works great

sed...
1,613
Posted By Xubuntu56
Combining multiple greps
I'm trying to learn about regular expressions. Let's say I want to list all the files in /usr/bin beginning with "p", ending with "x", and containing an "a".
I know this works:ls | grep ^p | grep x$...
8,681
Posted By Xubuntu56
Thanks to all. @vgersh99--your code gave a...
Thanks to all.
@vgersh99--your code gave a complete listing of all man pages with short descriptions, which is what I originally wanted

@stomp--your code showed me all the "a" pages with a short...
8,681
Posted By Xubuntu56
Listing certain man pages
How would I go about making a list of all man pages beginning with the letter "a"?
I have tried:

man a*
man [ a ]*
man [a*]
man {a}*
man {a*}
man "a*"
man 'a'*
man 'a*'
1,561
Posted By Xubuntu56
Wow! Thanks much. :) I believe I found a use...
Wow! Thanks much. :)
I believe I found a use for >&2, uncommon though it may be: redirecting stdout to where stderr was previously redirected to.
{ ecko "Hello" || echo "World" } 2>error.txt...
1,561
Posted By Xubuntu56
A command sends either fd1 or fd2, correct?...
A command sends either fd1 or fd2, correct? That's why neither history 2> test.txt nor hissory 1> test.txt work very well?
I'm still trying to understand the duplicating part of all this.
1,561
Posted By Xubuntu56
Confused about redirecting stderr
I know that

mmmmm 2> error.txt

will send the error message to the specified file instead of the screen. However, I have seen

>&2

in some scripts, and I can't get it to do anything. A...
546
Posted By Xubuntu56
Saving first n lines of history
Say you want to clear your .bash_history except for the first 25 lines. Try:
sed -i -e 26,500d .bash_historyI have a some frequently-used routines parked in the first few lines, and they kept...
1,574
Posted By Xubuntu56
@rbattel-- Yes, that's exactly what I get. I will...
@rbattel-- Yes, that's exactly what I get. I will work on flag/variable success/failure suggestion.


@joeyg--I'm not sure how to use the Found/NotFound.


@vgersh99--I must have done something...
1,574
Posted By Xubuntu56
@joeyg--I wanted a single response, either "Yes,...
@joeyg--I wanted a single response, either "Yes, that is a bird." or "That is not a bird."
@vbe--I tried something else, but unfortunately it appears I need a stronger hint! Now, it works correctly...
1,574
Posted By Xubuntu56
Simple conditional yields too many responses
In this script:
#!/bin/bash
# bird
read -p "Enter name of a bird "
REPLY=$REPLY
birdname="duck sparrow hawk"
for i in $birdname
do
if [[ "$REPLY" = "$i" ]]
then
...
1,364
Posted By Xubuntu56
@nezabudka--I got your first code to work fine; I...
@nezabudka--I got your first code to work fine; I don't know how to employ the parameter thing

To all--I made this up myself, and it works! I know it's not elegant!
echo...
1,364
Posted By Xubuntu56
@Scrutinizer--both perfect, thanks!
@Scrutinizer--both perfect, thanks!
1,364
Posted By Xubuntu56
Gentlemen, thank you! @Scrutinizer--your...
Gentlemen, thank you!
@Scrutinizer--your suggestions worked very well; I just need to figure out how to put spaces after the commas.
@RudiC--your second suggestion worked perfectly after escaping...
1,364
Posted By Xubuntu56
Removing unwanted symbols with sed
I would like produce

blue, green, red, yellowfrom"blue:,*green:,*red:,*yellowI can remove the colon with
echo "blue:,*green:,*red:,*yellow" | sed 's/://g'which givesblue,*green,*red,*yellowbut...
Forum: What is on Your Mind? 02-08-2019
2,776
Posted By Xubuntu56
In the news this morning: "Popular iPhone...
In the news this morning:
"Popular iPhone apps are recording their users' every tap and swipe, according to a TechCrunch report."
Certain iPhone apps are reportedly tracking their users' every...
Showing results 1 to 25 of 38

 
All times are GMT -4. The time now is 06:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy