How to slice a horizontal tail of a single lineHow can I find a file whose name includes a given string, such...
Is adding a new player (or players) a DM decision, or a group decision?
How to get cool night-vision without lame drawbacks?
Employer wants to use my work email account after I quit, is this legal under German law? Is this a GDPR waiver?
Cascading Repair Costs following Blown Head Gasket on a 2004 Subaru Outback
What are the benefits of using the X Card safety tool in comparison to plain communication?
How to determine what is the correct level of detail when modelling?
Smooth Julia set for quadratic polynomials
Change CPU MHz from Registry
Is this one of the engines from the 9/11 aircraft?
How to split an equation over two lines?
What happens when I sacrifice a creature when my Teysa Karlov is on the battlefield?
How to perform Login Authentication at the client-side?
Plotting with different color for a single curve
Is there a maximum distance from a planet that a moon can orbit?
C-152 carb heat on before landing in hot weather?
Why does the numerical solution of an ODE move away from an unstable equilibrium?
Short and long term plans in a closed game in the Sicilian Defense
Can the US president have someone sent to jail?
Animation advice please
Does ultrasonic bath cleaning damage laboratory volumetric glassware calibration?
How to append a matrix element by element
When is it ok to add filler to a story?
Would a two-seat light aircaft with a landing speed of 20 knots and a top speed of 180 knots be technically possible?
Story-based adventure with functions and relationships
How to slice a horizontal tail of a single line
How can I find a file whose name includes a given string, such as “abcde”?Regarding separate a single file into multiple files according to line separationHow to pass wildcards in command lineGenerating/validating checksums in a single line?can I use logical operators to remove all files that matches with one and/or other pattern in a single line?How to list files and directories of a mount pointHow to get the mplayer's single-line playing progress info?tail: illegal option — -53r error while using head and tail on same file in single scriptHow do you slice in shell?How to convert visible control characters back to non-printing characters (opposite of 'cat -v')?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
given
file1
1:b:c:4
file2
1:3:47:8:aa:2
file3
1:4:5:8:9:11:aaaaa:2:3:4:88:9:10
I want to find the tail of this line after the ':'. To note each file only contains one line always
For example
$ command file1
4
$ command file2
2
$ command file3
10
linux shell
New contributor
add a comment |
given
file1
1:b:c:4
file2
1:3:47:8:aa:2
file3
1:4:5:8:9:11:aaaaa:2:3:4:88:9:10
I want to find the tail of this line after the ':'. To note each file only contains one line always
For example
$ command file1
4
$ command file2
2
$ command file3
10
linux shell
New contributor
add a comment |
given
file1
1:b:c:4
file2
1:3:47:8:aa:2
file3
1:4:5:8:9:11:aaaaa:2:3:4:88:9:10
I want to find the tail of this line after the ':'. To note each file only contains one line always
For example
$ command file1
4
$ command file2
2
$ command file3
10
linux shell
New contributor
given
file1
1:b:c:4
file2
1:3:47:8:aa:2
file3
1:4:5:8:9:11:aaaaa:2:3:4:88:9:10
I want to find the tail of this line after the ':'. To note each file only contains one line always
For example
$ command file1
4
$ command file2
2
$ command file3
10
linux shell
linux shell
New contributor
New contributor
New contributor
asked 13 mins ago
aki aki
1
1
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
awk -F: '{print $NF}' file*
This awk command will print the last column (seperated by : (colon))
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
aki is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f526336%2fhow-to-slice-a-horizontal-tail-of-a-single-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
awk -F: '{print $NF}' file*
This awk command will print the last column (seperated by : (colon))
add a comment |
awk -F: '{print $NF}' file*
This awk command will print the last column (seperated by : (colon))
add a comment |
awk -F: '{print $NF}' file*
This awk command will print the last column (seperated by : (colon))
awk -F: '{print $NF}' file*
This awk command will print the last column (seperated by : (colon))
answered 5 mins ago
KamarajKamaraj
3,0511 gold badge5 silver badges14 bronze badges
3,0511 gold badge5 silver badges14 bronze badges
add a comment |
add a comment |
aki is a new contributor. Be nice, and check out our Code of Conduct.
aki is a new contributor. Be nice, and check out our Code of Conduct.
aki is a new contributor. Be nice, and check out our Code of Conduct.
aki is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f526336%2fhow-to-slice-a-horizontal-tail-of-a-single-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown