How can I count all the lines of code in a directory recursi

Issues with installing under all GNU/Linux Distributions
Post Reply
balasahu
Posts: 2
Joined: Thu Jun 07, 2018 7:21 pm
Location: India

How can I count all the lines of code in a directory recursi

Post by balasahu »

We've got a PHP application and want to count all the lines of code under a specific directory and its subdirectories.

We don't need to ignore comments, as we're just trying to get a rough idea.

Code: Select all

wc -l *.php
That command works great for a given directory, but it ignores subdirectories. I was thinking the following comment might work, but it is returning 74, which is definitely not the case...

Code: Select all

find . -name '*.php' | wc -l
What's the correct syntax to feed in all the files from a directory recursively?

I read this article but could not find any solution.

https://edumotivation.com/wc-command/
Last edited by balasahu on Sun May 02, 2021 9:18 am, edited 2 times in total.
FJCC
Moderator
Posts: 9231
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Unable to install OpenOffice in Ubuntu

Post by FJCC »

You have to download the package from www.openffice.org and install it manually. There are instructions here.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Villeroy
Volunteer
Posts: 31264
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Unable to install OpenOffice in Ubuntu

Post by Villeroy »

You already have LibreOffice installed. LibreOffice is the new OpenOffice. Almost the same software.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Unable to install OpenOffice in Ubuntu

Post by RoryOF »

If you really want OpenOffice rather than LibreOffice (some of us do), for Ubuntu you should download the deb version from the download page (linked off the OpenOffice icon at bottom right of Forum window). Expand that file, then do

Code: Select all

sudo apt purge libreoffice*
Then

Code: Select all

cd ~/Downloads/en-US/DEBS
sudo dpkg -i *.deb
cd desktop-integration
sudo dpkg -i *.deb
 Edit: the en-US portion of the directory path may differ according to the language version you downloaded. 
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Villeroy
Volunteer
Posts: 31264
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Unable to install OpenOffice in Ubuntu

Post by Villeroy »

OpenOffice is barely usable with Ubuntu's vanilla window manager "Unity".
It always focusses the wrong window. A new OpenOffice window always lands at the bottom of the window stack. Dialogs are not focussed before you click on them.
More importantly, OpenOffice does not support Windows shares. menu:File>Open shows the all the contents of a Windows share, but I can not open any of the office documents (nothing happens with no error). Under Windows you have to map the share to a drive letter which is not an option when running Linux.
The version of LibreOffice which is shipped with the distribution is very well integrated into the overall desktop environment, supports all kinds of network resources (including cloud drives) and a lot more foreign file formats which can be particularly important when you change systems.
For some reason I don't know, LibreOffice does not install the Base component. If you want to do anything database related (e.g. serial letters and label printing) you can install the missing package like this:

Code: Select all

sudo apt install libreoffice-base
I'm aware of the theoretical advantages of OpenOffice over LibreOffice but I would not recommend OpenOffice to first time Linux users. They have enough fights to struggle.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
RoryOF
Moderator
Posts: 34570
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Unable to install OpenOffice in Ubuntu

Post by RoryOF »

I use OO on Xubuntu 18.04 with no problems; the problem with Windows shares requires a share to be marked as follows - I quote a line from my rc.local to mount a remote share on boot

Code: Select all

mount -t cifs //192.168.N.MM/Impress -o username=XXXXXXXXX,password=YYYYYYYYYYYYY,uid=1000,gid=1000,vers=1.0 /home/XXXXXXXXX/Desktop/Buffalo/Presentations
The clue was the "vers=1.0"
 Edit: I offer this solution in case it helps someone. 
Gigolo mounts were easier and did not need this, but I don't use them; if I get problems with shares on future Xubuntu releases, I may transition to them, but I try to make minimal changes to permit my daily work continue without interruption.

If one is a newcomer to linux, it may be much easier to use the LibreOffice in the distro repositories.

What Villeroy says about the Unity interface not co-operating with OO is no doubt correct; I don't use Unity as I prefer the simpler interface of Xubuntu.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Post Reply