Try this way:
wc -l < file.txt
More Related Contents:
- Useless use of cat?
- Using cURL to upload POST data with files
- Interactive shell using Docker Compose
- What are the uses of the exec command in shell scripts? [closed]
- What’s an easy way to read random line from a file?
- Returning value from called function in a shell script
- Alternative to `sed -i` on Solaris
- Is there an Eclipse plugin to run system shell in the Console? [closed]
- commands not found on zsh [closed]
- Rename multiple files by replacing a particular pattern in the filenames using a shell script [duplicate]
- How do you catch error codes in a shell pipe?
- Concise and portable “join” on the Unix command-line
- How to add timestamp to STDERR redirection
- How do I get the effect and usefulness of “set -e” inside a shell function?
- How can I redirect the output of the “time” command?
- How to ssh to vagrant without actually running “vagrant ssh”?
- How to check if a process is running inside docker container?
- Make a keybinding to run previous or last shell commands
- How to set child process’ environment variable in Makefile
- How to source a script in a Makefile?
- How do I prevent root access to my docker container
- How to run a command in the background and get no output?
- How to input automatically when running a shell over SSH?
- How to call a function in shell Scripting?
- How do I set tmux to open specified windows at startup?
- Take a full page screenshot with Firefox on the command-line
- Which terminal command to get just IP address and nothing else?
- How to add text at the end of each line in unix
- How to print 5 consecutive lines after a pattern in file using awk [duplicate]
- how do I use the grep –include option for multiple file types?