Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to use cat grep and cut together? Post 303044558 by synack on Wednesday 26th of February 2020 10:04:33 AM
Old 02-26-2020
Thank you for being so quick and fair in your answers


The 1st proposition works perfectly. the second almost except that for the servers not found, there is this:
;; reached
( you can send me a other command line if you want )


in any case to you two

just for knowledge, could it have been done with cat grep and cut?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

cat and grep not working

I am trying to cat a file and then grep that file for a number. I can do it fine on other files but this particular file will not do anything. I tried running it on an older file from the same device but it is just not working. The file is nothing more than a flat file on a unix box. Here is just a... (3 Replies)
Discussion started by: jphess
3 Replies

2. UNIX for Dummies Questions & Answers

cat, grep and tee to a local file

Hi, This is what I am trying to do. 1) connect to 3 remote servers from my local machine serverA serverB serverC 2) read error file from each server cat /var/lib/mysql/mydb.err 3) grep for lines displaying "yesterday" date grep "`date +%y%m%d' '-d\"1 day ago\"`" 4) Append those lines to a... (7 Replies)
Discussion started by: shantanuo
7 Replies

3. Shell Programming and Scripting

cat or cut to delimit csv?

Hi, Im a pretty large noob to linux/perl etc and im trying to use mysql slurp to take a delimited file and import it into mysql using stdin (in the hope its faster) mysqlslurp - slurp <STDIN> into a MySQL table - search.cpan.org Christopher Brown / MySQL-Slurp - search.cpan.org Using... (3 Replies)
Discussion started by: newtony
3 Replies

4. Shell Programming and Scripting

cat /etc/passwd and grep -v on /etc/shells

Hi All, I'd like to do this cat /etc/passwd and grep -v on the /etc/shells list I'd like to find all shell that doesn't exist on the /etc/passwd. Is there an easy way without doing a egrep -v "/bin/sh|/bin/bash................"? How do I use a file /etc/shells as my list for... (4 Replies)
Discussion started by: itik
4 Replies

5. Shell Programming and Scripting

cat -n and grep

I am not sure if using cat -n is the most efficient way to split a file into multiple files, one file per line in the source file. I thought using cat -n would make it easy to process the file because it produces an output that numbers each line that I could then grep for with the regex "^ *$i".... (3 Replies)
Discussion started by: kapu
3 Replies

6. Shell Programming and Scripting

grep or cat using sed

Is there a way using grep or cat a file to create a new file based on whether the first 9 positions of each record is less than 399999999? This is a fixed file format. (3 Replies)
Discussion started by: ski
3 Replies

7. Slackware

How should I cut this line using cut and grep?

not sure how to do it. wan't to delete it using cut and grep ince i would use it in the shell. but how must the command be? grep "64.233.181.103 wwwGoogle.com" /etc/hosts | cut -d the delimeter is just a space. can you help meplease. :D (1 Reply)
Discussion started by: garfish
1 Replies

8. UNIX for Dummies Questions & Answers

Grep and cat combined

Hello, i need to search one word (snp1) from many files and copy the content of the columns of this word in new file. example: file 1: SNP BP CHR P snp1 1 3 0.01 snp2 2 2 0.05 . . file 2: SNP BP CHR P snp1 1 3 0.06 snp2 2 2 0.3 output... (6 Replies)
Discussion started by: biopsy
6 Replies

9. Shell Programming and Scripting

Replace cat and grep with <

Hello someone told me to use OS=`awk '{print int($3)}' < /etc/redhat-release` instead of OS=cat /etc/redhat-release | `awk '{print int($3)}'` any idea for the reason ? (5 Replies)
Discussion started by: nimafire
5 Replies

10. UNIX for Dummies Questions & Answers

Grep or cat The Whole Directory PROBLEMS :(

Hi Guys This is my first post so I am not sure how things go here. I'm sorry if I'm breaking the rule or something. Feel free to correct me about that :) So as I was saying... I'd been trying to grep this folder containing 900,000 txt files but seems no luck. I get either "No such file... (6 Replies)
Discussion started by: Nexeu
6 Replies
aptsh(1)						      General Commands Manual							  aptsh(1)

NAME
Aptsh - interactive APT shell SYNOPSIS
aptsh {install pkg | remove pkg | update | ... } [-?, --help] [-c, --config-file configuration_file ] [-s, --storing] [-v, --version] [-x, --execute aptsh_command ] DESCRIPTION
Aptsh is a tool which makes using APT much easier. It gives you an interactive shell with all those sweet features like tab-completion (which you can use to complete name of a package), simpler access to apt commands and easier package searching (ls, rls). Although it's not necessary, it just tries to make life easier. Other way of using Aptsh is using it as a normal command-line tool, a replacement for apt-* commands. USAGE
We'll try to do some ordinary administration tasks - install/remove/search few packages. As a root, type 'aptsh' and press return. Then type 'ins', and press Tab - 'ins' should change into 'install' followed by a whitespace. Now write down 'kde', and press Tab twice - if you're using Debian or other large distro, it should ask you whether you want to see all packages which begin with 'kde'. As you should have noticed - it works exactly like a good shell. You can also play with 'remove' - then aptsh will prompt only installed packages. And remember, that you can pipe results of commands (ie. dump | grep ^Package | cut -d -f 2 | grep ^kde ). You can execute a normal shell command by preceding it with ".". COMMANDS
Aptsh commands: dump-cfg Dump all aptsh options. dpkg Query dpkg. ls Search for packages by matching names to a wildcard. Remember that in some enviroments you have to put the expression between " " or preced special chars with . rls Search for packages by matching names to a regular expression. Read note about special chars above! whatis Display a short description of a package. whichpkg Find the package that supplies the given command or file. listfiles List all files owned by a package. news Obtain the latest news about the package from Debian servers changelog Retrieve latest changelog for the package from Debian servers toupgrade List packages with newer versions available for upgrading ` Change mode. queue-commit Commit stored commands. User answers to all prompts. queue-commit-say Commit commands kept in command queue, automatically answering to all prompts. It should be followed by the answer, if not, it answers (then usually program's behaviour is default). Proper usage of commit-say would be "commit-say y" - then Aptsh answers 'y' to all prompts. queue Display currently stored commands. queue-remove Remove stored commands from list. It should be followed by list or section of numbers of items to remove. Proper usage of this command would be: "commit-remove 1 3 10-15 21" - it will remove items numbered as 1, 3, 10, 11, 12, 13, 14, 15, 21. You can use alias 'last' which refers to the last item. queue-clear Clear list of stored commands orphans Find orphaned libraries on your system. orphans-all Find all orphaned packages on your system, not only libraries. It's output is other than the orphans' one - it's splitted into two columns, first one contains packages' Section, second Name. help Executes 'man aptsh', or displays short info about commands (if any were given as arguments). help-howto Displays HOWTO. You can pipe it to a browser ("more" or "less") or grep it. quit Erm... quit? :) apt-get querying commands (see man apt-get): install update upgrade dselect-upgrade dist-upgrade remove purge (same as remove --purge ) source build-dep check clean autoclean apt-cache querying commands (see man apt-cache): show dump add showpkg stats showsrc dumpavail unmet search depends rdepends pkgnames dotty policy madison AUTHOR
Marcin Wrochniak (wrochniak@gmail.com) version 0.0.6 20 Mar 2005 aptsh(1)
All times are GMT -4. The time now is 10:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy