Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Linux command: sed
(view source)
Revision as of 16:00, 25 January 2018
287 bytes added
,
16:00, 25 January 2018
no edit summary
Line 31:
Line 31:
== Mongo operators to Python List ==
== Mongo operators to Python List ==
cat mongodb_operators.txt | grep -E ^\\\$ | awk '{ print "\x27" $1 "\x27" }' | sed s/\\\$//g | sed ':a;N;$!ba;s/\n/, /g'
cat mongodb_operators.txt | grep -E ^\\\$ | awk '{ print "\x27" $1 "\x27" }' | sed s/\\\$//g | sed ':a;N;$!ba;s/\n/, /g'
+
+
== Print some line of a file ==
+
To print line 45 from file rigodon-22011715-3.jl.ok
+
sed -n 45p rigodon-22011715-3.jl.ok
+
+
To print multiple lines:
+
sed -n -e 5p -e 8p file
+
To print a range of lines:
+
sed -n 5,8p file
+
To print a range and some specific file:
+
sed -n -e 5,8p -e 10p file
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version